feat(api_core): make the last retry happen at deadline#9873
Merged
plamut merged 2 commits intogoogleapis:masterfrom Dec 10, 2019
Merged
feat(api_core): make the last retry happen at deadline#9873plamut merged 2 commits intogoogleapis:masterfrom
plamut merged 2 commits intogoogleapis:masterfrom
Conversation
7576edc to
8cb31da
Compare
5 tasks
tswast
reviewed
Nov 26, 2019
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.
Contributor
Author
|
@tswast I made the "strict deadline" behavior non-optional, it's now the default logic of Retry instances. |
tswast
approved these changes
Dec 10, 2019
This was referenced Jan 29, 2020
[CHANGE ME] Re-generated container to pick up changes in the API or client library generator.
#10256
Closed
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.
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.
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