Title: Retry should generate sleep time after attempt · Issue #792 · googleapis/python-api-core · GitHub
Open Graph Title: Retry should generate sleep time after attempt · Issue #792 · googleapis/python-api-core
X Title: Retry should generate sleep time after attempt · Issue #792 · googleapis/python-api-core
Description: 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...
Open Graph Description: 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 T...
X Description: 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 T...
Opengraph URL: https://github.com/googleapis/python-api-core/issues/792
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Retry should generate sleep time after attempt","articleBody":"Currently our retry logic [pulls the next sleep time from the generator](https://github.com/googleapis/python-api-core/blob/7fbd5fda207d856b5835d0e0166df52e4819522a/google/api_core/retry/retry_streaming_async.py#L114) before starting an rpc. This allows us to [immediately fail with a ValueError](https://github.com/googleapis/python-api-core/blob/7fbd5fda207d856b5835d0e0166df52e4819522a/google/api_core/retry/retry_streaming_async.py#L192) if the generator stops providing backoff values\n\nThe downside of this approach is that the backoff is locked in before the rpc is attempted.\n\nBigtable [has a feature](https://github.com/googleapis/google-cloud-python/issues/15304) 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.\n\nTo support this feature, I suggest that we only call the backoff generator when we are ready for the next sleep.\n","author":{"url":"https://github.com/daniel-sanche","@type":"Person","name":"daniel-sanche"},"datePublished":"2025-02-13T23:12:50.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/792/python-api-core/issues/792"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:1bc7e237-b614-3ec2-2237-0f5c973198bf |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B10C:3B3BAC:2AC48A:3EEA5B:6A4E02D5 |
| html-safe-nonce | de8114240cfe5efd4b200a20bf89bd34c2663df05ee9f38412ca2418a9294572 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMTBDOjNCM0JBQzoyQUM0OEE6M0VFQTVCOjZBNEUwMkQ1IiwidmlzaXRvcl9pZCI6Ijg3OTUyMjQ4MzA3MTIzNDkzOTciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 8ac6d4d751c42c8d5a93dd913b2a46996f4c9aacec4c06de66c59a16c690becb |
| hovercard-subject-tag | issue:2852291910 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/googleapis/python-api-core/792/issue_layout |
| twitter:image | https://opengraph.githubassets.com/3a8611827dd66ac076f520e88740b1e0537164edc6a30559351b312fab7823f6/googleapis/python-api-core/issues/792 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/3a8611827dd66ac076f520e88740b1e0537164edc6a30559351b312fab7823f6/googleapis/python-api-core/issues/792 |
| og:image:alt | 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 T... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | daniel-sanche |
| hostname | github.com |
| expected-hostname | github.com |
| None | df0492960db29b4938cb72070351d6b1d0c6c0767b27ceb8394bbf4fcc0223c6 |
| turbo-cache-control | no-preview |
| go-import | github.com/googleapis/python-api-core git https://github.com/googleapis/python-api-core.git |
| octolytics-dimension-user_id | 16785467 |
| octolytics-dimension-user_login | googleapis |
| octolytics-dimension-repository_id | 226992456 |
| octolytics-dimension-repository_nwo | googleapis/python-api-core |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 226992456 |
| octolytics-dimension-repository_network_root_nwo | googleapis/python-api-core |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 52bde38e24398476f8eb1e0760c81346c6a00812 |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width