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

Update 429 retry-after response handling #1305

Merged
merged 4 commits into from
Mar 3, 2021
Merged

Update 429 retry-after response handling #1305

merged 4 commits into from
Mar 3, 2021

Conversation

abraunegg
Copy link
Owner

  • For every http perform action, check the response headers for any retry-after response

* For every http perform action, check the response headers for any retry-after response
* Add check to explicit 429 check as well, as there are potentially other cases which will trigger a 429, but unless check, might not get handled correctly
remove extra line
@abraunegg abraunegg added this to the v2.4.11 milestone Mar 1, 2021
@abraunegg abraunegg linked an issue Mar 2, 2021 that may be closed by this pull request
5 tasks
@abraunegg
Copy link
Owner Author

Without PR:

* Mark bundle as not supporting multiuse
< HTTP/1.1 429 Too Many Requests
< Retry-After: 150100
...
< Date: Sat, 27 Feb 2021 20:26:40 GMT
< Content-Length: 0
< 
* Connection #19 to host public.dm.files.1drv.com left intact

OneDrive returned a 'HTTP 429 - Too Many Requests' - gracefully handling error
[DEBUG] onedrive.downloadById(item.driveId, item.id, path, fileSize); generated a OneDriveException
[DEBUG] Handling a OneDrive HTTP 429 Response Code (Too Many Requests)
[DEBUG] Using Retry-After Value = 0
[DEBUG] HTTP Response Header retry-after value was 0 - Using a preconfigured default of: 120
Thread sleeping due to 'HTTP request returned status code 429' - The request has been throttled
Sleeping for 120 seconds

Even though the 429 is handled, the Retry-After: 150100 is being missed.

With PR:
Before OneDrive returned a 'HTTP 429 - Too Many Requests' - gracefully handling error is presented as log output, check the HTTP response headers each time a 429 is encountered, ensuring that if retry-after is present, the flag is correctly enabled & the correct value is used.

@abraunegg abraunegg merged commit 81e40ba into master Mar 3, 2021
@abraunegg abraunegg deleted the fix-issue-1304 branch March 3, 2021 00:12
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked and limited conversation to collaborators May 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Retry-After is not honored in case of HTTP response 429 Too many requests.
1 participant