Fixed - BlockingQueue.take method doesn't survey failover (regression) #1680

pull/1705/head
Nikita 7 years ago
parent 9c69d25caf
commit a66e82b544

@ -83,7 +83,7 @@ public class CommandsQueue extends ChannelDuplexHandler {
new WriteRedisConnectionException("Channel has been closed! Can't write command: "
+ LogHelper.toString(command.getCommand()) + " to channel: " + ctx.channel()));
if (command.getChannelPromise().isSuccess()) {
if (command.getChannelPromise().isSuccess() && !command.getCommand().isBlockingCommand()) {
command.getCommand().tryFailure(new RedisConnectionClosedException("Command "
+ LogHelper.toString(command.getCommand()) + " succesfully sent, but channel " + ctx.channel() + " has been closed!"));
}

@ -107,4 +107,9 @@ public class CommandsData implements QueueCommand {
return promise.isDone();
}
@Override
public boolean isBlockingCommand() {
return false;
}
}

@ -29,5 +29,7 @@ public interface QueueCommand {
boolean tryFailure(Throwable cause);
boolean isExecuted();
boolean isBlockingCommand();
}

Loading…
Cancel
Save