[JUJU-4504] Implement timeout-based retry method for txns#69
Open
nvinuesa wants to merge 1 commit intojuju:masterfrom
Open
[JUJU-4504] Implement timeout-based retry method for txns#69nvinuesa wants to merge 1 commit intojuju:masterfrom
nvinuesa wants to merge 1 commit intojuju:masterfrom
Conversation
This patch is part of the set of patchs aiming to fix https://bugs.launchpad.net/juju/+bug/2031631. The idea here is to implement a transaction retry mechanism similar to the one being used in the official mongodb driver, i.e. a 120 seconds timeout for transactions to finish or waiting while being retried. The context passed to the mgo Run method is necessary in order to cancel the actual request that's being executed by mgo either after timeout, either because the user (juju) cancels the passed context. Tests have been fixed and some have been deleted since they are no longer relevant (we don't retry for a fixed number of times, instead we retry until timeout).
e1d4a17 to
ee572ee
Compare
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.
This patch is part of the set of patches aiming to fix https://bugs.launchpad.net/juju/+bug/2031631.
The idea here is to implement a transaction retry mechanism similar to the one being used in the official mongodb driver, i.e. a 120 seconds timeout for transactions to finish or waiting while being retried.
The context passed to the mgo Run method is necessary in order to cancel the actual request that's being executed by mgo either after timeout, either because the user (juju) cancels the passed context.
Tests have been fixed and some have been deleted since they are no longer relevant (we don't retry for a fixed number of times, instead we retry until timeout).
For some more context, here is the high-level picture of how we handle the retry (from
jujutomgoviatxn) by @hpidcock :Note: The original PR on juju is juju/juju#16159 and on
juju/mgois juju/mgo#27.