From a12722ec92f5c7d49347136cf3a9581d9ff0e08d Mon Sep 17 00:00:00 2001 From: Nikita Koksharov Date: Thu, 14 Mar 2019 12:03:33 +0300 Subject: [PATCH] Fixed - command response shouldn't be printed in case of timeout #1654 --- .../org/redisson/client/handler/CommandDecoder.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/redisson/src/main/java/org/redisson/client/handler/CommandDecoder.java b/redisson/src/main/java/org/redisson/client/handler/CommandDecoder.java index 2e039cc6c..192ee2876 100644 --- a/redisson/src/main/java/org/redisson/client/handler/CommandDecoder.java +++ b/redisson/src/main/java/org/redisson/client/handler/CommandDecoder.java @@ -94,10 +94,6 @@ public class CommandDecoder extends ReplayingDecoder { protected final void decode(ChannelHandlerContext ctx, ByteBuf in, List out) throws Exception { QueueCommand data = ctx.channel().attr(CommandsQueue.CURRENT_COMMAND).get(); - if (log.isTraceEnabled()) { - log.trace("reply: {}, channel: {}, command: {}", in.toString(0, in.writerIndex(), CharsetUtil.UTF_8), ctx.channel(), data); - } - if (state.get() == null) { state.set(new State()); } @@ -109,7 +105,7 @@ public class CommandDecoder extends ReplayingDecoder { in.markReaderIndex(); skipCommand(in); in.resetReaderIndex(); - + decode(ctx, in, data); } } else { @@ -124,6 +120,10 @@ public class CommandDecoder extends ReplayingDecoder { } private void decode(ChannelHandlerContext ctx, ByteBuf in, QueueCommand data) throws Exception { + if (log.isTraceEnabled()) { + log.trace("reply: {}, channel: {}, command: {}", in.toString(0, in.writerIndex(), CharsetUtil.UTF_8), ctx.channel(), data); + } + if (decodeInExecutor && !(data instanceof CommandsData)) { ByteBuf copy = in.copy(in.readerIndex(), in.writerIndex() - in.readerIndex()); in.skipBytes(in.writerIndex() - in.readerIndex()); @@ -442,7 +442,7 @@ public class CommandDecoder extends ReplayingDecoder { protected void completeResponse(CommandData data, Object result, Channel channel) { if (data != null && !data.getPromise().trySuccess(result) && data.cause() instanceof RedisTimeoutException) { - log.warn("response has been skipped due to timeout! channel: {}, command: {}, result: {}", channel, LogHelper.toString(data), LogHelper.toString(result)); + log.warn("response has been skipped due to timeout! channel: {}, command: {}", channel, LogHelper.toString(data)); } }