From 6844c9362dc94e96c458d92bce177e6a063272d7 Mon Sep 17 00:00:00 2001 From: Simone Bordet Date: Thu, 9 Jul 2020 13:27:44 +0200 Subject: [PATCH] Issue #4904 - WebsocketClient creates more connections than needed. Fixed MultiplexConnectionPool.acquire() to use the new boolean parameter to decide whether or not create a new connection. This fixes ConnectionPoolTest instability. Signed-off-by: Simone Bordet --- .../org/eclipse/jetty/client/MultiplexConnectionPool.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/MultiplexConnectionPool.java b/jetty-client/src/main/java/org/eclipse/jetty/client/MultiplexConnectionPool.java index a048629095cc..43f124e85a87 100644 --- a/jetty-client/src/main/java/org/eclipse/jetty/client/MultiplexConnectionPool.java +++ b/jetty-client/src/main/java/org/eclipse/jetty/client/MultiplexConnectionPool.java @@ -57,10 +57,10 @@ public MultiplexConnectionPool(HttpDestination destination, int maxConnections, } @Override - public Connection acquire() + protected Connection acquire(boolean create) { Connection connection = activate(); - if (connection == null) + if (connection == null && create) { int queuedRequests = getHttpDestination().getQueuedRequestCount(); int maxMultiplex = getMaxMultiplex();