Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1605,6 +1605,7 @@ public CompletableFuture<QueryResponse> query(String sqlQuery, Map<String, Objec
if (httpResponse.getCode() == HttpStatus.SC_SERVICE_UNAVAILABLE) {
LOG.warn("Failed to get response. Server returned {}. Retrying. (Duration: {})", System.nanoTime() - startTime, httpResponse.getCode());
selectedEndpoint = getNextAliveNode();
HttpAPIClientHelper.closeQuietly(httpResponse);
continue;
}

Expand All @@ -1625,7 +1626,7 @@ public CompletableFuture<QueryResponse> query(String sqlQuery, Map<String, Objec
return new QueryResponse(httpResponse, responseFormat, requestSettings, metrics);

} catch (Exception e) {
httpClientHelper.closeQuietly(httpResponse);
HttpAPIClientHelper.closeQuietly(httpResponse);
lastException = httpClientHelper.wrapException(String.format("Query request failed (Attempt: %s/%s - Duration: %s)",
(i + 1), (retries + 1), System.nanoTime() - startTime), e);
if (httpClientHelper.shouldRetry(e, requestSettings.getAllSettings())) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -473,10 +473,14 @@ public ClassicHttpResponse executeRequest(Endpoint server, Map<String, Object> r
closeQuietly(httpResponse);
LOG.warn("Failed to connect to '{}': {}", server.getBaseURL(), e.getMessage());
throw e;
} catch (Exception e) {
closeQuietly(httpResponse);
LOG.debug("Failed to execute request to '{}': {}", server.getBaseURL(), e.getMessage(), e);
throw e;
}
}

public void closeQuietly(ClassicHttpResponse httpResponse) {
public static void closeQuietly(ClassicHttpResponse httpResponse) {
if (httpResponse != null) {
try {
httpResponse.close();
Expand Down
Loading