Skip to content

Commit

Permalink
Fix asynchronous resource cleanup on failed connect #1768
Browse files Browse the repository at this point in the history
  • Loading branch information
mp911de committed Jun 18, 2021
1 parent cacdfc6 commit 63728f8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/java/io/lettuce/core/RedisClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ private <K, V> ConnectionFuture<StatefulRedisConnection<K, V>> connectStandalone
future.whenComplete((channelHandler, throwable) -> {

if (throwable != null) {
connection.close();
connection.closeAsync();
}
});

Expand Down Expand Up @@ -602,8 +602,8 @@ private <K, V> ConnectionFuture<StatefulRedisSentinelConnection<K, V>> doConnect
return sync.thenApply(ignore -> (StatefulRedisSentinelConnection<K, V>) 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();
}
});
}
Expand Down

0 comments on commit 63728f8

Please sign in to comment.