Commit d8b8256f authored by Julien Muchembled's avatar Julien Muchembled

Comment about "bootstrap: retry migration if previous transaction failed"

Commit 11f57b83 does not work in most cases,
and may be a bad idea.
We should probably simplify the code again as follows:

  global _bootstrapped # initialized to None at module level
  if _bootstrapped != portal.id:
    _bootstrapped = portal.id
    ...
parent 8a52c1d7
......@@ -342,6 +342,11 @@ def synchronizeDynamicModules(context, force=False):
# Thanks to TransactionalResource, the '_bootstrapped' global variable
# is updated in a transactional way. Without it, it would be required to
# restart the instance if anything went wrong.
# XXX: In fact, TransactionalResource does not solve anything here, because
# portal cookie is unlikely to change and this function will return
# immediately, forcing the user to restart.
# This may not be so bad after all: it enables the user to do easily
# some changes that are required for the migration.
if portal.id not in _bootstrapped and \
TransactionalResource.registerOnce(__name__, 'bootstrap', portal.id):
migrate = False
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment