From eb243e3f391d194ec8b731a6ce05dbc97bc975a1 Mon Sep 17 00:00:00 2001 From: xujie Date: Mon, 3 Aug 2020 13:55:28 +0800 Subject: [PATCH] fix: check RedisConnection status befor RedisConnection object join freeConnections Signed-off-by: xujie --- .../org/redisson/connection/ClientConnectionsEntry.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/redisson/src/main/java/org/redisson/connection/ClientConnectionsEntry.java b/redisson/src/main/java/org/redisson/connection/ClientConnectionsEntry.java index a7fdcdcf7..b83e7a2e7 100644 --- a/redisson/src/main/java/org/redisson/connection/ClientConnectionsEntry.java +++ b/redisson/src/main/java/org/redisson/connection/ClientConnectionsEntry.java @@ -151,6 +151,10 @@ public class ClientConnectionsEntry { } public void releaseConnection(RedisConnection connection) { + if (connection.isClosed()) { + return; + } + if (client != connection.getRedisClient()) { connection.closeAsync(); return; @@ -225,6 +229,10 @@ public class ClientConnectionsEntry { } public void releaseSubscribeConnection(RedisPubSubConnection connection) { + if (connection.isClosed()) { + return; + } + if (client != connection.getRedisClient()) { connection.closeAsync(); return;