Fixed - closed connections handling

pull/1821/head
Nikita 7 years ago
parent b23643a340
commit 03c541f8f7

@ -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);

Loading…
Cancel
Save