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

VR-4525: Retry part uploads on ConnectionErrors #729

Merged
merged 4 commits into from Jun 9, 2020

Conversation

convoliution
Copy link
Contributor

@convoliution convoliution commented Jun 6, 2020

I wanted to specifically only catch broken pipes, but unwrapping a requests exception is tedious and undocumented! This is how deep I had to go in my investigation:
Screen Shot 2020-06-08 at 3 57 28 PM
Rather than have a series of ifs that I can't even justify with docs because there are none, I'm comfortable with retrying on all ConnectionErrors for just this presigned URL upload.

@convoliution convoliution self-assigned this Jun 6, 2020
@convoliution convoliution marked this pull request as draft June 8, 2020 18:37
@convoliution convoliution marked this pull request as ready for review June 8, 2020 23:02
@convoliution convoliution changed the title Retry part uploads on ConnectionErrors VR-4525: Retry part uploads on ConnectionErrors Jun 8, 2020
try:
response = _utils.make_request("PUT", url, self._conn, data=part_stream)
except requests.ConnectionError:
time.sleep(10)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems way too long. Is there any specific reason for this choice?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No particular reason at all. Should I remove the sleep?

Wanted a bit of backoff delay for connection problems, and 10s seemed small to me in comparison to how long a 64 MB part upload can take.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe 1s? Consider that the user would have to sit 30s before knowing something is wrong.

@convoliution convoliution merged commit 7c7bedb into master Jun 9, 2020
@convoliution convoliution deleted the client/ml/upload branch June 9, 2020 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants