Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support abort hooks (symmetrically to commit hooks) #77 #81

Merged
merged 8 commits into from
Jun 19, 2019

Conversation

d-maurer
Copy link
Contributor

@d-maurer d-maurer commented May 7, 2019

Fixes #77

@d-maurer d-maurer requested a review from jamadden May 7, 2019 07:40
Copy link
Member

@jamadden jamadden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for putting this together!

I left some questions that I'd like to gain some insight on. It might be good to get other's opinions too (/cc @tseaver @jimfulton @mgedmin)

transaction/_transaction.py Outdated Show resolved Hide resolved
transaction/interfaces.py Outdated Show resolved Hide resolved
transaction/_transaction.py Outdated Show resolved Hide resolved
transaction/_transaction.py Outdated Show resolved Hide resolved
transaction/_transaction.py Outdated Show resolved Hide resolved
transaction/_transaction.py Show resolved Hide resolved
@d-maurer
Copy link
Contributor Author

d-maurer commented May 14, 2019 via email

@d-maurer
Copy link
Contributor Author

The discussion in #82 reminded my that all hooks must be cleared after commit/abort (which currently is not yet ensured).

@d-maurer
Copy link
Contributor Author

commit likely calls _free and _callAfterCommitHooks in the wrong order: the _free informs the transaction manager that the current transaction has terminated; if the manager is in "implicit" mode, then it will (effectively) start a new transaction. The _callAfterCommitHooks has special code to clean up the resource managers in the case that a hook call has changed one of them. However, it looks at its own resource managers (cleared by _free) while the hook has potentially affected those of a new transaction.

@d-maurer d-maurer requested a review from jamadden June 19, 2019 08:08
@d-maurer
Copy link
Contributor Author

@jamadden I have followed most of your suggestions. Would you like to take another look?

Copy link
Member

@jamadden jamadden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@d-maurer d-maurer merged commit c76fd72 into master Jun 19, 2019
@d-maurer d-maurer deleted the abort_hooks_#77 branch June 19, 2019 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support abort hooks (symmetrically to commit hooks)
2 participants