Specify --speed-limit and --speed-time for the fetch script
This change will cause curl to cancel and retry the connection if the connection to the remote is exceedingly slow.
Note this change does apply some "policy" by expecting the user's internet connection to be at least 20% the speed of modern DSL: If the connection can't sustain at least 250,000 bytes per second for 15 seconds, curl will disconnect and try again.
I don't know if the rust project has data on users in that threshold or not, but this is upstreaming a change from our fork of this script in DeterminateSystems/nix-installer.
@grahamc Thanks for submitting this patch! Would you mind providing more info about the rationale of this change though?
Looking at the solution you are trying to resolve, I'm a bit worried that this will not be a generally good default for our users around the globe. Even if we are adding support for this, we might want to add an extra env var for opting in and specifying the low water mark.
@rami3l We've seen a number of users end up with a stalled download due to a bad route or similar. The connection is alive enough to not trigger timeouts and fail, but not alive enough to complete in a reasonable amount of time. The goal of this PR is to cause it to disconnect and retry on a fresh connection.