From af42377d0e83cf73d345ffc3c88032a6c3048cbc Mon Sep 17 00:00:00 2001 From: Claudio Atzori Date: Mon, 28 Jun 2021 09:34:30 +0200 Subject: [PATCH] HttpClient used in metadata collection retries on 502, 503, 504 --- .../main/java/eu/dnetlib/dhp/collection/HttpConnector2.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dhp-workflows/dhp-aggregation/src/main/java/eu/dnetlib/dhp/collection/HttpConnector2.java b/dhp-workflows/dhp-aggregation/src/main/java/eu/dnetlib/dhp/collection/HttpConnector2.java index 3782a19e4d..a84b269551 100644 --- a/dhp-workflows/dhp-aggregation/src/main/java/eu/dnetlib/dhp/collection/HttpConnector2.java +++ b/dhp-workflows/dhp-aggregation/src/main/java/eu/dnetlib/dhp/collection/HttpConnector2.java @@ -142,9 +142,10 @@ public class HttpConnector2 { throw new CollectorException("4xx error: request will not be repeated. " + report); } if (is5xx(urlConn.getResponseCode())) { - // SERVER SIDE ERRORS RETRY ONLY on 503 switch (urlConn.getResponseCode()) { + case HttpURLConnection.HTTP_BAD_GATEWAY: case HttpURLConnection.HTTP_UNAVAILABLE: + case HttpURLConnection.HTTP_GATEWAY_TIMEOUT: if (retryAfter > 0) { log .warn(