diff options
author | David Kalnischkies <david@kalnischkies.de> | 2017-10-25 21:40:56 +0200 |
---|---|---|
committer | David Kalnischkies <david@kalnischkies.de> | 2017-12-13 23:56:29 +0100 |
commit | 2f6aed72f656494d668918aa8ce4052d7c81e993 (patch) | |
tree | 9164324417ff42e425b7f981aa2685302157952c /methods | |
parent | 07cd99066c30e70a9f41851c80e7c51f4e507163 (diff) |
mark some 500 HTTP codes as transient acquire errors
If retries are enabled only transient errors are retried, which are very
few errors. At least for some HTTP codes it could be beneficial to retry
them through so adding them seems like a good idea if only to be more
consistent in what we report.
Diffstat (limited to 'methods')
-rw-r--r-- | methods/basehttp.cc | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/methods/basehttp.cc b/methods/basehttp.cc index c77ab28c6..3b4c60720 100644 --- a/methods/basehttp.cc +++ b/methods/basehttp.cc @@ -801,7 +801,19 @@ int BaseHttpMethod::Loop() case ERROR_WITH_CONTENT_PAGE: { Server->RunDataToDevNull(Req); - Fail(); + constexpr unsigned int TransientCodes[] = { + 408, // Request Timeout + 429, // Too Many Requests + 500, // Internal Server Error + 502, // Bad Gateway + 503, // Service Unavailable + 504, // Gateway Timeout + 599, // Network Connect Timeout Error + }; + if (std::find(std::begin(TransientCodes), std::end(TransientCodes), Req.Result) != std::end(TransientCodes)) + Fail(true); + else + Fail(); break; } |