Skip to content

Commit

Permalink
Make sure the parent 'responseFuture' CompletableFuture is completed.
Browse files Browse the repository at this point in the history
This ensures that the jettyRequest.abort() operation is actually performed.

Current situation prevent this code to be ever called as only the chained CompletableFuture is completed.
  • Loading branch information
daijithegeek authored and jansupol committed Aug 1, 2022
1 parent 8cf7cab commit 1e6c692
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -392,8 +392,8 @@ public Future<?> apply(final ClientRequest jerseyRequest, final AsyncConnectorCa
final AtomicBoolean callbackInvoked = new AtomicBoolean(false);
final Throwable failure;
try {
final CompletableFuture<ClientResponse> responseFuture =
new CompletableFuture<ClientResponse>().whenComplete(
final CompletableFuture<ClientResponse> responseFuture = new CompletableFuture<ClientResponse>();
responseFuture.whenComplete(
(clientResponse, throwable) -> {
if (throwable != null && throwable instanceof CancellationException) {
// take care of future cancellation
Expand Down

0 comments on commit 1e6c692

Please sign in to comment.