Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retry should generate sleep time after attempt #792

Open
daniel-sanche opened this issue Feb 13, 2025 · 1 comment · May be fixed by #793
Open

Retry should generate sleep time after attempt #792

daniel-sanche opened this issue Feb 13, 2025 · 1 comment · May be fixed by #793
Assignees
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@daniel-sanche
Copy link
Contributor

daniel-sanche commented Feb 13, 2025

Currently our retry logic pulls the next sleep time from the generator before starting an rpc. This allows us to immediately fail with a ValueError if the generator stops providing backoff values

The downside of this approach is that the backoff is locked in before the rpc is attempted.

Bigtable has a feature where the server can provide a backoff value to the client for the next attempt. The design of Python's retry classes is flexible enough to allow this, except for the fact that the next backoff value is locked in early.

To support this feature, I suggest that we only call the backoff generator when we are ready for the next sleep.

@daniel-sanche daniel-sanche added priority: p2 Moderately-important priority. Fix may not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. labels Feb 13, 2025
@daniel-sanche
Copy link
Contributor Author

opened a PR: #793

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants