From ed25fdd66e35840e1c73f283bba0671747005572 Mon Sep 17 00:00:00 2001 From: Domen Kožar Date: Wed, 29 Jan 2020 11:47:39 +0100 Subject: retry on HTTP status code 429 (cherry picked from commit 48ddb8e481c0ba0b59b7193df4aa914ce83a9032) --- src/libstore/download.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/libstore') diff --git a/src/libstore/download.cc b/src/libstore/download.cc index cdf56e09d69a..b1a7a02822b6 100644 --- a/src/libstore/download.cc +++ b/src/libstore/download.cc @@ -357,9 +357,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: -- cgit 1.4.1