From 03c541f8f7e17061ccca924d25ff8857a050bfd6 Mon Sep 17 00:00:00 2001 From: Nikita Date: Wed, 3 Oct 2018 19:00:14 +0300 Subject: [PATCH] Fixed - closed connections handling --- .../main/java/org/redisson/client/handler/CommandsQueue.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/redisson/src/main/java/org/redisson/client/handler/CommandsQueue.java b/redisson/src/main/java/org/redisson/client/handler/CommandsQueue.java index 9e1b0fa94..10846f36b 100644 --- a/redisson/src/main/java/org/redisson/client/handler/CommandsQueue.java +++ b/redisson/src/main/java/org/redisson/client/handler/CommandsQueue.java @@ -21,6 +21,7 @@ import java.util.Queue; import java.util.regex.Pattern; import org.redisson.client.ChannelName; +import org.redisson.client.RedisConnectionException; import org.redisson.client.WriteRedisConnectionException; import org.redisson.client.protocol.CommandData; import org.redisson.client.protocol.QueueCommand; @@ -79,6 +80,10 @@ public class CommandsQueue extends ChannelDuplexHandler { command.getChannelPromise().tryFailure( new WriteRedisConnectionException("Channel has been closed! Can't write command: " + command.getCommand() + " to channel: " + ctx.channel())); + + if (command.getChannelPromise().isSuccess()) { + command.getCommand().tryFailure(new RedisConnectionException("Command succesfully sent, but channel " + ctx.channel() + " has been closed!")); + } } super.channelInactive(ctx);