From cf699c5895e49ace58844b4642aa1c881574d35c Mon Sep 17 00:00:00 2001 From: David Joaquim Date: Fri, 29 Jul 2022 15:15:36 +0200 Subject: [PATCH] Make sure the parent 'responseFuture' CompletableFuture is completed. 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. --- .../org/glassfish/jersey/jetty/connector/JettyConnector.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/connectors/jetty-connector/src/main/java/org/glassfish/jersey/jetty/connector/JettyConnector.java b/connectors/jetty-connector/src/main/java/org/glassfish/jersey/jetty/connector/JettyConnector.java index 1456d4b5bd..89a0c05eb7 100644 --- a/connectors/jetty-connector/src/main/java/org/glassfish/jersey/jetty/connector/JettyConnector.java +++ b/connectors/jetty-connector/src/main/java/org/glassfish/jersey/jetty/connector/JettyConnector.java @@ -392,8 +392,8 @@ public Future apply(final ClientRequest jerseyRequest, final AsyncConnectorCa final AtomicBoolean callbackInvoked = new AtomicBoolean(false); final Throwable failure; try { - final CompletableFuture responseFuture = - new CompletableFuture().whenComplete( + final CompletableFuture responseFuture = new CompletableFuture(); + responseFuture.whenComplete( (clientResponse, throwable) -> { if (throwable != null && throwable instanceof CancellationException) { // take care of future cancellation