diff --git a/src/main/java/io/lettuce/core/RedisClient.java b/src/main/java/io/lettuce/core/RedisClient.java index 4d477f2b68..8554b76274 100644 --- a/src/main/java/io/lettuce/core/RedisClient.java +++ b/src/main/java/io/lettuce/core/RedisClient.java @@ -290,7 +290,7 @@ private ConnectionFuture> connectStandalone future.whenComplete((channelHandler, throwable) -> { if (throwable != null) { - connection.close(); + connection.closeAsync(); } }); @@ -602,8 +602,8 @@ private ConnectionFuture> doConnect return sync.thenApply(ignore -> (StatefulRedisSentinelConnection) connection).whenComplete((ignore, e) -> { if (e != null) { - logger.warn("Cannot connect Redis Sentinel at " + redisURI + ": " + e.toString()); - connection.close(); + logger.warn("Cannot connect Redis Sentinel at " + redisURI + ": " + e); + connection.closeAsync(); } }); }