Cancel connection request on exception
This commit is contained in:
parent
290ec22022
commit
9cde791f35
|
@ -116,11 +116,14 @@ class InternalExecRuntime implements ExecRuntime, Cancellable {
|
||||||
log.debug("{} acquired endpoint {}", id, ConnPoolSupport.getId(connectionEndpoint));
|
log.debug("{} acquired endpoint {}", id, ConnPoolSupport.getId(connectionEndpoint));
|
||||||
}
|
}
|
||||||
} catch(final TimeoutException ex) {
|
} catch(final TimeoutException ex) {
|
||||||
|
connRequest.cancel();
|
||||||
throw new ConnectionRequestTimeoutException(ex.getMessage());
|
throw new ConnectionRequestTimeoutException(ex.getMessage());
|
||||||
} catch(final InterruptedException interrupted) {
|
} catch(final InterruptedException interrupted) {
|
||||||
|
connRequest.cancel();
|
||||||
Thread.currentThread().interrupt();
|
Thread.currentThread().interrupt();
|
||||||
throw new RequestFailedException("Request aborted", interrupted);
|
throw new RequestFailedException("Request aborted", interrupted);
|
||||||
} catch(final ExecutionException ex) {
|
} catch(final ExecutionException ex) {
|
||||||
|
connRequest.cancel();
|
||||||
Throwable cause = ex.getCause();
|
Throwable cause = ex.getCause();
|
||||||
if (cause == null) {
|
if (cause == null) {
|
||||||
cause = ex;
|
cause = ex;
|
||||||
|
|
Loading…
Reference in New Issue