From deea34a82f384c7a938ef0947a08bb8f2ada5cd9 Mon Sep 17 00:00:00 2001 From: Nikita Date: Mon, 11 Sep 2017 17:29:34 +0300 Subject: [PATCH] unnecessary ByteBuf.release invocation during last attempt to write execution --- .../main/java/org/redisson/command/CommandAsyncService.java | 4 +--- .../main/java/org/redisson/command/CommandBatchService.java | 1 - 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/redisson/src/main/java/org/redisson/command/CommandAsyncService.java b/redisson/src/main/java/org/redisson/command/CommandAsyncService.java index 6ae3c22e4..e364e86f3 100644 --- a/redisson/src/main/java/org/redisson/command/CommandAsyncService.java +++ b/redisson/src/main/java/org/redisson/command/CommandAsyncService.java @@ -28,7 +28,6 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; -import io.netty.util.ReferenceCountUtil; import org.redisson.RedisClientResult; import org.redisson.RedissonReference; import org.redisson.RedissonShutdownException; @@ -64,10 +63,10 @@ import org.redisson.misc.RedissonObjectFactory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import io.netty.buffer.ByteBuf; import io.netty.channel.Channel; import io.netty.channel.ChannelFuture; import io.netty.channel.ChannelFutureListener; +import io.netty.util.ReferenceCountUtil; import io.netty.util.Timeout; import io.netty.util.TimerTask; import io.netty.util.concurrent.Future; @@ -539,7 +538,6 @@ public class CommandAsyncService implements CommandAsyncExecutor { if (details.getWriteFuture() == null || !details.getWriteFuture().isDone()) { if (details.getAttempt() == connectionManager.getConfig().getRetryAttempts()) { if (details.getWriteFuture().cancel(false)) { - free(details); if (details.getException() == null) { details.setException(new RedisTimeoutException("Unable to send command: " + command + " with params: " + LogHelper.toString(details.getParams() + " after " + connectionManager.getConfig().getRetryAttempts() + " retry attempts"))); } diff --git a/redisson/src/main/java/org/redisson/command/CommandBatchService.java b/redisson/src/main/java/org/redisson/command/CommandBatchService.java index 46753f21f..f2199f6c7 100644 --- a/redisson/src/main/java/org/redisson/command/CommandBatchService.java +++ b/redisson/src/main/java/org/redisson/command/CommandBatchService.java @@ -298,7 +298,6 @@ public class CommandBatchService extends CommandAsyncService { if (details.getWriteFuture() == null || !details.getWriteFuture().isDone()) { if (details.getAttempt() == attempts) { if (details.getWriteFuture().cancel(false)) { - free(entry); if (details.getException() == null) { details.setException(new RedisTimeoutException("Unable to send batch after " + connectionManager.getConfig().getRetryAttempts() + " retry attempts")); }