aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2025-04-24 12:52:00 +0200
committerGitHub Enterprise <[email protected]>2025-04-24 12:52:00 +0200
commit1301b12c57206df23886b004bcfbc21cac5e953a (patch)
tree5b060a03ec090a335aa0e877e22e01a829ef4ce9
parent5.6.6-pre0 (diff)
downloadzen-1301b12c57206df23886b004bcfbc21cac5e953a.tar.xz
zen-1301b12c57206df23886b004bcfbc21cac5e953a.zip
add retry on internal error / bad gateway (#370)
* do http client retry on internal error and bad gateway
-rw-r--r--CHANGELOG.md1
-rw-r--r--src/zenhttp/httpclient.cpp4
2 files changed, 4 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index f4dca4c21..749fae571 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,6 @@
##
- Improvement: Made metadata presentation for cooked output entries more generic
+- Improvement: Retry http client requests if we get an unspecified internal error or a bad gateway response
- Bugfix: Use proper FindClose call when using fallback when getting file attributes on windows
- Bugfix: Fixed race condition at final chunks when downloading multipart blobs which could lead to corruption and/or crash
- Bugfix: Fixed BigInt conversion error affecting the tree view in the web UI
diff --git a/src/zenhttp/httpclient.cpp b/src/zenhttp/httpclient.cpp
index 763f3262a..ca1b820c9 100644
--- a/src/zenhttp/httpclient.cpp
+++ b/src/zenhttp/httpclient.cpp
@@ -365,9 +365,10 @@ ShouldRetry(const cpr::Response& Response)
{
case cpr::ErrorCode::OK:
break;
- case cpr::ErrorCode::OPERATION_TIMEDOUT:
+ case cpr::ErrorCode::INTERNAL_ERROR:
case cpr::ErrorCode::NETWORK_RECEIVE_ERROR:
case cpr::ErrorCode::NETWORK_SEND_FAILURE:
+ case cpr::ErrorCode::OPERATION_TIMEDOUT:
return true;
default:
return false;
@@ -377,6 +378,7 @@ ShouldRetry(const cpr::Response& Response)
case HttpResponseCode::RequestTimeout:
case HttpResponseCode::TooManyRequests:
case HttpResponseCode::InternalServerError:
+ case HttpResponseCode::BadGateway:
case HttpResponseCode::ServiceUnavailable:
case HttpResponseCode::GatewayTimeout:
return true;