Skip to content

Commit

Permalink
Issue #4904 - WebsocketClient creates more connections than needed.
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
sbordet committed Jul 9, 2020
1 parent 7bcbc21 commit 6844c93
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 6844c93

Please sign in to comment.