the metadata collection plugins using the HttpConnector2 class shall now retry instead of failing in case of UnknownHostException

This commit is contained in:
Claudio Atzori 2024-08-05 16:55:07 +02:00
parent b8bc237079
commit 6b4fa7b8b9
1 changed files with 2 additions and 2 deletions

View File

@ -214,11 +214,11 @@ public class HttpConnector2 {
.format(
"Unexpected status code: %s errors: %s", urlConn.getResponseCode(),
MAPPER.writeValueAsString(report)));
} catch (MalformedURLException | UnknownHostException e) {
} catch (MalformedURLException e) {
log.error(e.getMessage(), e);
report.put(e.getClass().getName(), e.getMessage());
throw new CollectorException(e.getMessage(), e);
} catch (SocketTimeoutException | SocketException e) {
} catch (SocketTimeoutException | SocketException | UnknownHostException e) {
log.error(e.getMessage(), e);
report.put(e.getClass().getName(), e.getMessage());
backoffAndSleep(getClientParams().getRetryDelay() * retryNumber * 1000);