diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/SelectConnector.java b/jetty-client/src/main/java/org/eclipse/jetty/client/SelectConnector.java index dcdec3bb689..853e7e70f4d 100644 --- a/jetty-client/src/main/java/org/eclipse/jetty/client/SelectConnector.java +++ b/jetty-client/src/main/java/org/eclipse/jetty/client/SelectConnector.java @@ -228,6 +228,10 @@ class SelectConnector extends AbstractLifeCycle implements HttpClient.Connector @Override protected void connectionFailed(SocketChannel channel, Throwable ex, Object attachment) { + Timeout.Task connectTimeout = _connectingChannels.remove(channel); + if (connectTimeout != null) + connectTimeout.cancel(); + if (attachment instanceof HttpDestination) ((HttpDestination)attachment).onConnectionFailed(ex); else