-
-
Notifications
You must be signed in to change notification settings - Fork 876
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
Handle #925 rate limit error #1364
Handle #925 rate limit error #1364
Conversation
dada6ea
to
353d4fe
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really appreciate you making this, I've added a few comments
(also the GitHub way of referencing an issue would be to use the # symbol and then the number, i.e. #925
)
7519d61
to
2112630
Compare
8b473fb
to
d9aaa1e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome stuff, just a minor change and otherwise looks good.
Regarding:
Same is true for the header "X-RateLimit-Remaining" which is logged with the rest of the headers on line 141, but with the difference that is logged at debug level. If you think that's enough, I'd remove the log of this specific header in the handling of the 429 response code in favour of the more generic header dump
I prefer the current implementation with the specific error message at the warning level. My reasoning would be:
- It is more like for the log level to be set to info or warning levels than to debug levels.
- It is a way for the code to document itself, and additionally be more meaningful for the end user than just a dump of headers they need to know the implementation details to understand
But happy to hear your thoughts
* add status code 429 to the list of retriable errors FIXES pycontribs#925
d9aaa1e
to
0a51c50
Compare
About this comment
I agree with you, let's keep the more detailed log message at warning level in the status_code handling bit, since as you said it's unlikely users have debug log level enabled when runtime issues like this happen, and we add specific context about retries in the log message. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thanks for pushing through this.
Hello, |
@adhamselman |
Not just that. The backoff delay may be calculated to (for example) 20 seconds but the 'retry-after' value may be 30. |
FIXES #925