Bug 1193137: Remove commit_manually decorator from app version update task.#653
Merged
Merged
Conversation
Contributor
Author
|
I tried to add a test for this. Unfortunately, the transaction management wrappers of the test harness mean that we never actually commit any transactions, and the exit transaction code that throws this error is never called. I can't think of a good way around this. |
Contributor
|
r+ |
Contributor
|
I'm going to merge so the QA team has enough time to validate that before the micro-push |
magopian
added a commit
that referenced
this pull request
Aug 12, 2015
Bug 1193137: Remove `commit_manually` decorator from app version update task.
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
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.
As far as I can tell, what's happening on production is that, because we have a
transaction.atomicblock inside of atransaction.commit_manuallyblock in theupdate_addon_appsupportcron job, we always end that block with a pending commit.When that happens, in our version of django, anyway, the connection also seems to sometimes keep the
in_atomic_blockflag, which leaves that worker broken for any task that runs next.I've confirmed that this change fixes at least the first part of the problem. That cron job no longer ends with a transaction error. I haven't been able to reproduce the
TransactionManagementError: An error occurred in the current transaction. You can't execute queries until the end of the 'atomic' block.error in a local web instance yet, but I think this should fix that as well.