-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Retry if S3 returns 500 #3962
Comments
Currently the way curl operates a 500 isn't actually an error, but rather the I think the best way to solve this will be to first create a new error type: enum CargoCurlError {
Io(curl::Error),
Code(u32),
} Next implement the I'm gonna tag this as E-easy as I think it's a good starter bug, but if help is needed please just let me know! |
@alexcrichton I'm willing to offer a PR for this |
Awesome thanks @0X1A! Lemme know if you have any questions |
500, 502, 503, 504 status codes are all “spurious”. |
@0X1A Just checking in, are you still interested in working on this? |
@aturon Sorry, I've been a bit swamped recently, someone else is free to take this one |
This commit implements auto-retry for downloading crates from crates.io whenever a 5xx response is returned. This should help assist with automatic retries whenever Cargo attempts to download directly from S3 but S3 returns a 500 error, which is defined as "please retry again". This logic may be a little eager to retry *all* 500 errors, but there's a maximum cap on all retries regardless, so hopefully it doesn't result in too many problems. Closes rust-lang#3962
I've opened a PR for this at #4032 |
Automatically retry HTTP requests returning 5xx This commit implements auto-retry for downloading crates from crates.io whenever a 5xx response is returned. This should help assist with automatic retries whenever Cargo attempts to download directly from S3 but S3 returns a 500 error, which is defined as "please retry again". This logic may be a little eager to retry *all* 500 errors, but there's a maximum cap on all retries regardless, so hopefully it doesn't result in too many problems. Closes #3962
Crates.io redirects to S3 for /download requests. Sometimes S3 returns a 500, and cargo should automatically retry.
Cargo has network retry logic, but right now it only retries if the error is "spurious".
We should tweak
maybe_spurious
to count 500 as something that should be retried, not sure which one of the curl errors corresponds to that or if we should just check the status code like this check does.The text was updated successfully, but these errors were encountered: