Fixed - Connection leak if SSL connection got reconnected. #2845

pull/2853/head
Nikita Koksharov 5 years ago
parent 75e320663f
commit b707fe8e29

@ -249,7 +249,8 @@ public class RedisConnection implements RedisCommands {
private void close() { private void close() {
CommandData<?, ?> command = getCurrentCommand(); CommandData<?, ?> command = getCurrentCommand();
if (!isActive() if (!isActive()
|| (command != null && command.isBlockingCommand())) { || (command != null && command.isBlockingCommand())
|| !connectionPromise.isDone()) {
channel.close(); channel.close();
} else { } else {
RFuture<Void> f = async(RedisCommands.QUIT); RFuture<Void> f = async(RedisCommands.QUIT);

@ -201,6 +201,7 @@ public class RedisChannelInitializer extends ChannelInitializer<Channel> {
ctx.fireChannelActive(); ctx.fireChannelActive();
} else { } else {
RedisConnection connection = RedisConnection.getFrom(ctx.channel()); RedisConnection connection = RedisConnection.getFrom(ctx.channel());
connection.closeAsync();
connection.getConnectionPromise().tryFailure(e.cause()); connection.getConnectionPromise().tryFailure(e.cause());
} }
} }

Loading…
Cancel
Save