GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

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

@plamut plamut commented Nov 21, 2019 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

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.

All reactions
@plamut plamut added type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. api: core labels Nov 21, 2019
@plamut
plamut requested a review from busunkim96 as a code owner November 21, 2019 09:54
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Nov 21, 2019
@plamut
plamut requested a review from tswast November 21, 2019 09:54
@plamut
plamut force-pushed the iss-7831-core branch from 7576edc to 8cb31da Compare November 21, 2019 10:30
@plamut plamut mentioned this pull request Nov 21, 2019
feat(bigquery): add timeout parameter to QueryJob.done() method #9875
Merged
5 tasks done
tswast
tswast reviewed Nov 26, 2019
View reviewed changes
Comment thread api_core/google/api_core/retry.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

plamut added 2 commits December 9, 2019 09:50
@plamut
feat(api_core): allow setting Retry deadline as strict
4a5b3ee
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.
@plamut
feat(core): make the last retry happen at deadline
9c965ad
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
plamut force-pushed the iss-7831-core branch from 8cb31da to 9c965ad Compare December 9, 2019 10:02
@plamut 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
@plamut

plamut commented Dec 9, 2019

Copy link
Copy Markdown
Contributor Author

@tswast I made the "strict deadline" behavior non-optional, it's now the default logic of Retry instances.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@plamut
plamut requested a review from tswast December 9, 2019 14:19
tswast
tswast approved these changes Dec 10, 2019
View reviewed changes
@plamut
plamut merged commit 8177673 into googleapis:master Dec 10, 2019
@plamut
plamut deleted the iss-7831-core branch December 10, 2019 22:10
This was referenced Jan 29, 2020
chore(bigquery): bump copyright year to 2020, tweak docstring formatting (via synth) #10225
Merged
docs(language): change docstring formatting; bump copyright year to 2020 (via synth) #10234
Merged
[CHANGE ME] Re-generated container to pick up changes in the API or client library generator. #10256
Closed
[CHANGE ME] Re-generated datastore to pick up changes in the API or client library generator. #10261
Closed
parthea pushed a commit that referenced this pull request Nov 24, 2025
@plamut
feat(api_core): make the last retry happen at deadline (#9873)
f8c7d81
* 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@tswast tswast tswast approved these changes
@busunkim96 busunkim96 Awaiting requested review from busunkim96

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

api: core cla: yes This human has signed the Contributor License Agreement. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Core: Make the Retry objects complete "exactly" at deadline

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@plamut @tswast @googlebot
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.