Skip to content

Commit

Permalink
Fix asynchronous resource cleanup on failed connect #1768
Browse files Browse the repository at this point in the history
When a cluster node connection fails, we call now the asynchronous closeAsync method instead of the blocking close method.
  • Loading branch information
mp911de committed Jun 9, 2021
1 parent a96e243 commit 3c78ca0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/io/lettuce/core/cluster/RedisClusterClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ <K, V> ConnectionFuture<StatefulRedisConnection<K, V>> connectToNodeAsync(RedisC

return connectionFuture.whenComplete((conn, throwable) -> {
if (throwable != null) {
connection.close();
connection.closeAsync();
}
});
}
Expand Down Expand Up @@ -597,7 +597,7 @@ <K, V> ConnectionFuture<StatefulRedisPubSubConnection<K, V>> connectPubSubToNode
() -> new PubSubCommandHandler<>(getClusterClientOptions(), getResources(), codec, endpoint));
return connectionFuture.whenComplete((conn, throwable) -> {
if (throwable != null) {
connection.close();
connection.closeAsync();
}
});
}
Expand Down

0 comments on commit 3c78ca0

Please sign in to comment.