-
Notifications
You must be signed in to change notification settings - Fork 309
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
upload: add connection exceptions to upload retry protocol #1031
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.
There's no test for this and it purports to fix a bug on which no design was agreed
Sorry, meant to draft this from the start, PR was meant as a rough proposal and there a few things that are still unclear:
will add a test and a few improvements asap. |
@@ -183,21 +183,31 @@ def upload( | |||
) -> requests.Response: | |||
number_of_redirects = 0 |
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.
should I rename to retries? redirects aren't really handled here.
return resp | ||
|
||
return resp | ||
if resp.status_code == requests.codes.OK: |
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.
slighlty redundant, but can leave for clarity. Should add a continue to the retry if clause.
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.
Additionally, as the _upload function calls on POST without redirects, we aren't really handling anywhere (they are simply returned)
This doesn't merge cleanly, doesn't solve the problem at the right layer, and it re-invents a wheel for which there are many good solutions. I'm closing this. |
Addresses our intermittent upload issues as described that #1017 was initially trying to address.
Although we are mainly running into "connection reset by peer" exceptions, I've added connection timeouts, and I'd consider adding a sleep between retries.