From 12eaac401897c8eea19a7cc6033e470479f7705a Mon Sep 17 00:00:00 2001 From: Nikita Koksharov Date: Mon, 5 Jul 2021 11:58:12 +0300 Subject: [PATCH] ClientConnectionsEntry reverted --- .../org/redisson/connection/ClientConnectionsEntry.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/redisson/src/main/java/org/redisson/connection/ClientConnectionsEntry.java b/redisson/src/main/java/org/redisson/connection/ClientConnectionsEntry.java index bd496c135..bfd47c098 100644 --- a/redisson/src/main/java/org/redisson/connection/ClientConnectionsEntry.java +++ b/redisson/src/main/java/org/redisson/connection/ClientConnectionsEntry.java @@ -61,7 +61,7 @@ public class ClientConnectionsEntry { public ClientConnectionsEntry(RedisClient client, int poolMinSize, int poolMaxSize, int subscribePoolMinSize, int subscribePoolMaxSize, ConnectionManager connectionManager, NodeType nodeType) { this.client = client; - this.freeConnectionsCounter = new AsyncSemaphore(20); + this.freeConnectionsCounter = new AsyncSemaphore(poolMaxSize); this.connectionManager = connectionManager; this.nodeType = nodeType; this.freeSubscribeConnectionsCounter = new AsyncSemaphore(subscribePoolMaxSize); @@ -161,8 +161,7 @@ public class ClientConnectionsEntry { } public RedisConnection pollConnection() { - return freeConnections.peek(); -// return freeConnections.poll(); + return freeConnections.poll(); } public void releaseConnection(RedisConnection connection) { @@ -176,9 +175,7 @@ public class ClientConnectionsEntry { } connection.setLastUsageTime(System.nanoTime()); - if (freeConnections.isEmpty()) { - freeConnections.add(connection); - } + freeConnections.add(connection); } public RFuture connect() {