fix: don't timeout a slow version download #910
Merged
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.
Fixes #909.
This fixes the current timeout behavior, which will cause a timeout for any request lasting over 10 seconds, even if it is an in-progress download which is simply a bit slow. Change bumps time outs to 15s, and breaks out individual
got
timeout values sincesocket
is the timeout that makes the most sense to set (resets time out each time data is received), but once you break out one timeout you need to give the others values as well or they will have no timeout.I tested these changes on macOS with the "Network Link Conditioner" so that I could try different network conditions. With these changes it could successfully download with the "3G" profile, and it could start downloading with the "Edge" and "Very Bad Network" profiles as well, although I did not wait for those to complete as it would have taken hours.
cc @erickzhao