Repository navigation
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
|
Hi @Vivek1898, Thanks for reaching out us! Please resolve the conflicts. Thanks |
fdd1d05 to
1671a3f
Compare
|
Thanks. Rebased onto main at 1671a3f; the branch merges cleanly now, and the new test picks the HTTP client backend the same way |
|
The CLA is signed now; please re-run the check. |
`attempts` counts the original request, so 0 and 1 both mean no retries. `_translate_retry_config` passed it straight through as `max_retries`, which counts retries, so attempts=1 retried once. attempts=0 is rewritten to 1 by `retry_args` in the parent client before the Interactions client is built, so it retried once as well, sleeping for the full Retry-After before the second request. Map attempts to attempts - 1, floored at zero. The default when attempts is unset does not change. Fixes googleapis#3260
1671a3f to
10fdcce
Compare
|
Superseded by 0f688a6 on main (Mark Daoust, "fix(interactions): retries = attempts - 1"), which fixes #3260 and handles it better than this PR: it maps |
Fixes #3260.
HttpRetryOptions.attemptscounts the original request, so 0 and 1 both mean no retries. For the Interactions API,_translate_retry_configpassed that number straight through asmax_retries, which counts retries, soattempts=1sent the request twice.attempts=0behaved the same way becauseretry_argsin the parent client rewrites 0 to 1 before the Interactions client is built. In both cases the second request waited for the fullRetry-After, which on a free-tier daily quota means blocking for hours instead of failing at once.The translation now maps
attemptstoattempts - 1, floored at zero. The default whenattemptsis unset is unchanged.Tests in
tests/interactions/test_retry_options.py:attempts=0andattempts=1send exactly one request on a 429 and raiseRateLimitError;attempts=3sends up to three requests and succeeds when the third one does.