-
Notifications
You must be signed in to change notification settings - Fork 42
Issue441 automatic backoff retry on http429 #547
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
Conversation
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.
some quick points to further finetune
@@ -28,6 +28,7 @@ | |||
"flake8>=5.0.0", | |||
"time_machine", | |||
"pyproj>=3.2.0", # Pyproj is an optional, best-effort runtime dependency | |||
"re-assert", |
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.
we already have dirty_equals for these kind of things, wee should not add yet another utility here
|
||
assert caplog.messages == [ | ||
"Starting new HTTPS connection (1): example.test:443", | ||
] |
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.
there are only tests with retries but ending in failure, there are no tests about retries that end up in success
import requests | ||
import requests.adapters | ||
|
||
MAX_RETRIES = 3 |
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.
default of max 3 retries might be a bit low in practice in combination with default backoff_factor: last attempt will be roughly just be 4 seconds after first attempt, which might be too quick to stop trying
Because of conflicts: redoing this PR in #770 |
@soxofaan looks like something we can merge easily as this is mostly about using functionality from requests?