-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Fix Issue: “Asymmetric transaction rollback error” if commit callbacks throw exceptions #9955
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
If a callback in commit throws an excecption, the calling plugin needs to be able to distinguish this from a unsuccessful commit, so that it doesn't attempt a rollback on an already commited transaction. (Which would cause an “Asymmetric transaction rollback" error)
If a callback in commit throws an excecption, the calling plugin needs to be able to distinguish this from a unsuccessful commit, so that it doesn't attempt a rollback on an already commited transaction. (Which would cause an “Asymmetric transaction rollback" error)
If a callback in commit throws an excecption, the calling plugin needs to be able to distinguish this from a unsuccessful commit, so that it doesn't attempt a rollback on an already commited transaction. (Which would cause an “Asymmetric transaction rollback" error)
If a callback in commit throws an excecption, the calling plugin needs to be able to distinguish this from a unsuccessful commit, so that it doesn't attempt a rollback on an already commited transaction. (Which would cause an “Asymmetric transaction rollback" error)
maghamed
approved these changes
Jun 15, 2017
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sense for me.
Thanks for contribution
This was referenced Jun 15, 2017
I left a comment regarding this PR in the GitHub issue #6497 |
@maghamed - I've reverted the original changes and added the logging - so this is ready for another look. |
magento-team
pushed a commit
that referenced
this pull request
Jul 11, 2017
…commit callbacks throw exceptions #9955
magento-team
pushed a commit
that referenced
this pull request
Oct 3, 2017
…commit callbacks throw exceptions #9955
magento-team
pushed a commit
that referenced
this pull request
Oct 3, 2017
…commit callbacks throw exceptions #9955
magento-team
pushed a commit
that referenced
this pull request
Oct 6, 2017
…ck error” if commit callbacks throw exceptions #9955 - for 2.2
magento-team
pushed a commit
that referenced
this pull request
Oct 6, 2017
…ck error” if commit callbacks throw exceptions #9955 - for 2.2
magento-team
pushed a commit
that referenced
this pull request
Oct 6, 2017
…ck error” if commit callbacks throw exceptions #9955 - for 2.2
magento-team
pushed a commit
that referenced
this pull request
Oct 6, 2017
…ck error” if commit callbacks throw exceptions #9955 - for 2.2
lsrocha
pushed a commit
to chaordic/magento2
that referenced
this pull request
Jun 27, 2018
…ck error” if commit callbacks throw exceptions magento#9955 - for 2.2
lsrocha
pushed a commit
to chaordic/magento2
that referenced
this pull request
Jun 27, 2018
…ck error” if commit callbacks throw exceptions magento#9955 - for 2.2
lsrocha
pushed a commit
to chaordic/magento2
that referenced
this pull request
Jun 28, 2018
…ck error” if commit callbacks throw exceptions magento#9955 - for 2.2
lsrocha
pushed a commit
to chaordic/magento2
that referenced
this pull request
Jun 28, 2018
…ck error” if commit callbacks throw exceptions magento#9955 - for 2.2
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
If a callback in commit throws an excecption, the calling plugin needs to be able to distinguish this from a unsuccessful commit, so that it doesn't attempt a rollback on an already commited transaction. (Which would cause an “Asymmetric transaction rollback" error)
Description
Fixed Issues (if relevant)
Manual testing scenarios
Let a commit callback throw an exception
Example:
create a new search engine
Do not register a corresponding indexer handler for
Magento\CatalogSearch\Model\Indexer\IndexerHandlerFactory
The commit callback from the fulltext indexer plugin will cause an exception "There is no such indexer handler: dummy"
Trigger this commit (for example, save a product)
Expected result
Exception from the commit callback is thrown and can be catched later (for ex. by PHPUnit)
Actual result
rollback()
is called aftercommit()
already has been called for the same transaction, resulting in an “Asymmetric transaction rollback error” exception when Magento tries to commit or rollback the last transaction on the stack.Contribution checklist