-
Notifications
You must be signed in to change notification settings - Fork 25
Description
If a transaction has any after-commit hooks, abort is called on the transaction's resources after the hooks are called (see the _callAfterCommitHooks method):
https://github.com/zopefoundation/transaction/blob/master/transaction/_transaction.py#L372-L378
The MailDataManager treats this as an error condition and raises an exception without calling its onAbort callback.
I've added a test demonstrating the issue: kilink/repoze.sendmail@c26361e7ac4
(Note that I add the log handler just to demonstrate that an exception is being raised.)
I think the best way to deal with this may be to increment the MailDataManager's tpc_phase
attribute in tpc_finish
, and then check if the two-phase commit finished in the abort
method; if that's the case, no exception should be raised.
Another question is whether the onAbort
callback should be called in this case. I'm not sure that it should.