Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Retry on HTTP 50x errors #603
base: branch-25.04
Are you sure you want to change the base?
Retry on HTTP 50x errors #603
Changes from 22 commits
e2934fa
2ef47e4
bf33697
d7d377b
d89bf5e
b641240
9a01f42
5b7ccbd
58400cb
5860f41
b418c00
54f8a34
fb888c2
3ccec96
6a7235e
774dc58
ec31221
1644485
7edb900
94b7147
d6775b7
5e5e64a
5ff1ab7
17d5fe0
17895c4
85d4fd7
522e5d8
88133fa
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
I would suggest reorganizing the logic below to improve readability, such as separating handling of error code from http code, early breaking to reduce the indentation level. This is what I have in mind. Let me know of your thought:
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.
I was wondering whether a refactor like this made sense now. Let me take a look.
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.
17d5fe0 has something, if you're able to take another look. That's a bit of a compromise between the earlier setup and your suggestion:
while
loop condition, instead ofwhile (true)
. But the case where we've exceeded our maximum attempts is moved out of the loop, and runs when webreak
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.
Yes. The changes look good to me! Please do test it a bit.
Side note: Hopefully we will improve the way of testing in the future through mocking (#634).
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.
I think we have OK testing for this through the Python tests here.
That checks that we fail after two attempts, and the the expected message printed after the first attempt failed.
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 is an off by one error when the user sets the
set_http_max_attempts
to 1. Looking into it now.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.
Fixed in 85d4fd7.
Now the messages are