745 processed.append(operation) |
745 processed.append(operation) |
746 operation.handle_event('%s_event' % trstate) |
746 operation.handle_event('%s_event' % trstate) |
747 self.pending_operations[:] = processed |
747 self.pending_operations[:] = processed |
748 self.debug('%s session %s done', trstate, self.id) |
748 self.debug('%s session %s done', trstate, self.id) |
749 except: |
749 except: |
750 self.exception('error while %sing', trstate) |
750 self.critical('error while %sing', trstate, exc_info=True) |
751 # if error on [pre]commit: |
751 # if error on [pre]commit: |
752 # |
752 # |
753 # * set .failed = True on the operation causing the failure |
753 # * set .failed = True on the operation causing the failure |
754 # * call revert<event>_event on processed operations |
754 # * call revert<event>_event on processed operations |
755 # * call rollback_event on *all* operations |
755 # * call rollback_event on *all* operations |
757 # that seems more natural than not calling rollback_event |
757 # that seems more natural than not calling rollback_event |
758 # for processed operations, and allow generic rollback |
758 # for processed operations, and allow generic rollback |
759 # instead of having to implements rollback, revertprecommit |
759 # instead of having to implements rollback, revertprecommit |
760 # and revertcommit, that will be enough in mont case. |
760 # and revertcommit, that will be enough in mont case. |
761 operation.failed = True |
761 operation.failed = True |
762 for operation in processed: |
762 for operation in reversed(processed): |
763 operation.handle_event('revert%s_event' % trstate) |
763 try: |
|
764 operation.handle_event('revert%s_event' % trstate) |
|
765 except: |
|
766 self.critical('error while reverting %sing', trstate, |
|
767 exc_info=True) |
764 # XXX use slice notation since self.pending_operations is a |
768 # XXX use slice notation since self.pending_operations is a |
765 # read-only property. |
769 # read-only property. |
766 self.pending_operations[:] = processed + self.pending_operations |
770 self.pending_operations[:] = processed + self.pending_operations |
767 self.rollback(reset_pool) |
771 self.rollback(reset_pool) |
768 raise |
772 raise |