Skip to content

Commit

Permalink
Cancel connection request on exception
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanck authored and ok2c committed Nov 14, 2022
1 parent 290ec22 commit 9cde791
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,14 @@ public void acquireEndpoint(
log.debug("{} acquired endpoint {}", id, ConnPoolSupport.getId(connectionEndpoint));
}
} catch(final TimeoutException ex) {
connRequest.cancel();
throw new ConnectionRequestTimeoutException(ex.getMessage());
} catch(final InterruptedException interrupted) {
connRequest.cancel();
Thread.currentThread().interrupt();
throw new RequestFailedException("Request aborted", interrupted);
} catch(final ExecutionException ex) {
connRequest.cancel();
Throwable cause = ex.getCause();
if (cause == null) {
cause = ex;
Expand Down

0 comments on commit 9cde791

Please sign in to comment.