From 3c78ca0e218fc2a30e10e7430f5de1f6b32676ad Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Wed, 9 Jun 2021 09:25:19 +0200 Subject: [PATCH] Fix asynchronous resource cleanup on failed connect #1768 When a cluster node connection fails, we call now the asynchronous closeAsync method instead of the blocking close method. --- src/main/java/io/lettuce/core/cluster/RedisClusterClient.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/io/lettuce/core/cluster/RedisClusterClient.java b/src/main/java/io/lettuce/core/cluster/RedisClusterClient.java index 7f22519edc..87ff33fb82 100644 --- a/src/main/java/io/lettuce/core/cluster/RedisClusterClient.java +++ b/src/main/java/io/lettuce/core/cluster/RedisClusterClient.java @@ -552,7 +552,7 @@ ConnectionFuture> connectToNodeAsync(RedisC return connectionFuture.whenComplete((conn, throwable) -> { if (throwable != null) { - connection.close(); + connection.closeAsync(); } }); } @@ -597,7 +597,7 @@ ConnectionFuture> connectPubSubToNode () -> new PubSubCommandHandler<>(getClusterClientOptions(), getResources(), codec, endpoint)); return connectionFuture.whenComplete((conn, throwable) -> { if (throwable != null) { - connection.close(); + connection.closeAsync(); } }); }