-
Notifications
You must be signed in to change notification settings - Fork 146
Retry: sleep_for_retry uses max(wait, delay_max) — inflates small Retry-After to delay_max (60s floor) (#860) #868
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
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -297,7 +297,7 @@ def sleep_for_retry(self, response: BaseHTTPResponse) -> bool: | |
| else: | ||
| proposed_wait = self.get_backoff_time() | ||
|
|
||
| proposed_wait = max(proposed_wait, self.delay_max) | ||
| proposed_wait = min(proposed_wait, self.delay_max) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The delay_max should not apply to server returned retry_after, that should always be the source of truth. In this function we should just use proposed_wait directly, since for get_backoff_time() it already have proposed_backoff = min(proposed_backoff, self.delay_max).
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Made the change the reviewer asked for. What changed:
All 14 tests in Pushed 834000b. |
||
| self.check_proposed_wait(proposed_wait) | ||
| logger.debug(f"Retrying after {proposed_wait} seconds") | ||
| time.sleep(proposed_wait) | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.