aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/download.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2020-01-29 16:22:46 +0100
committerGitHub <noreply@github.com>2020-01-29 16:22:46 +0100
commit7be1a07a451d85b132ecd375813a723fc171fa03 (patch)
tree0a0e3005e97ef910fbd75b6689027e6687f730fb /src/libstore/download.cc
parent2242be83c61788b9c0736a92bb0b5c7bbfc40803 (diff)
parent48ddb8e481c0ba0b59b7193df4aa914ce83a9032 (diff)
Merge pull request #3335 from domenkozar/retry-429
retry on HTTP status code 429
Diffstat (limited to 'src/libstore/download.cc')
-rw-r--r--src/libstore/download.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libstore/download.cc b/src/libstore/download.cc
index 0c231ca1d..149c84765 100644
--- a/src/libstore/download.cc
+++ b/src/libstore/download.cc
@@ -363,9 +363,10 @@ struct CurlDownloader : public Downloader
} else if (httpStatus == 401 || httpStatus == 403 || httpStatus == 407) {
// Don't retry on authentication/authorization failures
err = Forbidden;
- } else if (httpStatus >= 400 && httpStatus < 500 && httpStatus != 408) {
+ } else if (httpStatus >= 400 && httpStatus < 500 && httpStatus != 408 && httpStatus != 429) {
// Most 4xx errors are client errors and are probably not worth retrying:
// * 408 means the server timed out waiting for us, so we try again
+ // * 429 means too many requests, so we retry (with a delay)
err = Misc;
} else if (httpStatus == 501 || httpStatus == 505 || httpStatus == 511) {
// Let's treat most 5xx (server) errors as transient, except for a handful: