# HG changeset patch # User Sylvain Thénault # Date 1265630719 -3600 # Node ID ee6362b4618d45e047e60d5997d73745288ac89b # Parent 99c18d3f95421392a1dbb8c8a8b760a3ae879ff5# Parent 593386221aa79f60b2f490589399e4ead6734a61 backport stable diff -r 99c18d3f9542 -r ee6362b4618d hooks/integrity.py --- a/hooks/integrity.py Mon Feb 08 12:25:15 2010 +0100 +++ b/hooks/integrity.py Mon Feb 08 13:05:19 2010 +0100 @@ -48,8 +48,6 @@ if _UNIQUE_CONSTRAINTS_HOLDER is session: _UNIQUE_CONSTRAINTS_HOLDER = None _UNIQUE_CONSTRAINTS_LOCK.release() - else: - assert _UNIQUE_CONSTRAINTS_HOLDER is None class _ReleaseUniqueConstraintsOperation(hook.Operation): def commit_event(self): diff -r 99c18d3f9542 -r ee6362b4618d server/session.py --- a/server/session.py Mon Feb 08 12:25:15 2010 +0100 +++ b/server/session.py Mon Feb 08 13:05:19 2010 +0100 @@ -471,9 +471,21 @@ self.debug('%s session %s done', trstate, self.id) except: self.exception('error while %sing', trstate) + # if error on [pre]commit: + # + # * set .failed = True on the operation causing the failure + # * call revert_event on processed operations + # * call rollback_event on *all* operations + # + # that seems more natural than not calling rollback_event + # for processed operations, and allow generic rollback + # instead of having to implements rollback, revertprecommit + # and revertcommit, that will be enough in mont case. operation.failed = True for operation in processed: operation.handle_event('revert%s_event' % trstate) + # res + self.pending_operations = processed + self.pending_operations self.rollback(reset_pool) raise self.pool.commit()