GeezerVison is showing github.com — feat(api_core): make the last retry happen at deadline by plamut · Pull Request #9873 · googleapis/google-cloud-python
Conversation
plamut
commented
Nov 21, 2019
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Fixes #9872.
Towards #7831.
This PR changes the behavior of Retry objects to complete retrying at the specified deadline.
Previously, Retry objects only checked if the next sleep period started before the deadline. This means that the last retry could happen considerably later than the deadline, which can be problematic if there is, say, a future sitting on top that cannot wait that long.
PR checklist
- Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
- Ensure the tests and linter pass
- Code coverage does not decrease (if any source code was changed)
- Appropriate docs were updated (if necessary)
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
If a deadline is set as strict, Retry will shorten the last sleep
period to end at the given deadline, and not possibly stretch beyond
it.
This commit changes Retry instances in a way that the last sleep period
is shortened so that its end matches at the given deadline. This
prevents the last sleep period to last way beyond the deadline.
plamut
changed the title
feat(api_core): allow setting Retry deadline as strict
feat(api_core): make the last retry happen at deadline
Dec 9, 2019
|
@tswast I made the "strict deadline" behavior non-optional, it's now the default logic of Retry instances.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Jan 29, 2020
parthea
pushed a commit
that referenced
this pull request
Nov 24, 2025
* feat(api_core): allow setting Retry deadline as strict
If a deadline is set as strict, Retry will shorten the last sleep
period to end at the given deadline, and not possibly stretch beyond
it.
* feat(core): make the last retry happen at deadline
This commit changes Retry instances in a way that the last sleep period
is shortened so that its end matches at the given deadline. This
prevents the last sleep period to last way beyond the deadline.
Reviewers
tswast
tswast approved these changes
busunkim96
Awaiting requested review from busunkim96
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
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.
|