Skip to content

Conversation

grahamc
Copy link

@grahamc grahamc commented Aug 25, 2025

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.

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.
@rami3l
Copy link
Member

rami3l commented Aug 30, 2025

@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.

@grahamc
Copy link
Author

grahamc commented Sep 2, 2025

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants