Fixed - don't send PING command for blocking queues. #1855

pull/1871/head
Nikita Koksharov 6 years ago
parent 79e03e13aa
commit 4f6cde2af5

@ -21,6 +21,7 @@ import org.redisson.api.RFuture;
import org.redisson.client.RedisClientConfig; import org.redisson.client.RedisClientConfig;
import org.redisson.client.RedisConnection; import org.redisson.client.RedisConnection;
import org.redisson.client.codec.StringCodec; import org.redisson.client.codec.StringCodec;
import org.redisson.client.protocol.CommandData;
import org.redisson.client.protocol.RedisCommands; import org.redisson.client.protocol.RedisCommands;
import io.netty.channel.ChannelHandler.Sharable; import io.netty.channel.ChannelHandler.Sharable;
@ -66,7 +67,9 @@ public class PingConnectionHandler extends ChannelInboundHandlerAdapter {
config.getTimer().newTimeout(new TimerTask() { config.getTimer().newTimeout(new TimerTask() {
@Override @Override
public void run(Timeout timeout) throws Exception { public void run(Timeout timeout) throws Exception {
if (future.cancel(false) || !future.isSuccess()) { CommandData<?, ?> commandData = connection.getCurrentCommand();
if ((commandData == null || !commandData.isBlockingCommand()) &&
(future.cancel(false) || !future.isSuccess())) {
ctx.channel().close(); ctx.channel().close();
} else { } else {
sendPing(ctx); sendPing(ctx);

Loading…
Cancel
Save