Skip to content
Open
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 @@ -291,6 +291,15 @@ private HttpExecuteResponse execute(HttpUriRequestBase apacheRequest, MetricColl
HttpHost target = determineTarget(apacheRequest);
ClassicHttpResponse httpResponse = httpClient.executeOpen(target, apacheRequest, localRequestContext);
return createResponse(httpResponse, apacheRequest);
} catch (IllegalStateException e) {
// TODO: remove this when a permanent fix is made upstream
// This is a workaround for a race condition where a connection is not properly acquired when httpClient attempts
// to execute a request on a connection from the pool. For now, we rethrow this as an IOException so upper layers
// have a chance to retry if possible
if ("Endpoint not acquired / already released".equals(e.getMessage())) {
throw new IOException("Failed to execute HTTP request", e);
}
throw e;
} finally {
THREAD_LOCAL_REQUEST_METRIC_COLLECTOR.remove();
}
Expand Down
Loading