In RedisClientBase.discard(), the txReplies queue is not cleared. This causes Reply gets to hang on next transaction. For example, testMultiDiscard hangs on the last line of testMultiExec:
private RedisClient client;
@Before
public void setUp() throws Exception {
client = new RedisClient("localhost", 6379);
}
@Test
public void testMultiDiscard() throws Exception {
client.set("testitnow", "willdo");
client.multi();
client.pipeline().set("testitnow", "notok");
client.discard();
assertEquals("willdo", new String(client.get("testitnow").data()));
// Ensure we can run a new tx after discarding previous one
testMultiExec();
}
@Test
public void testMultiExec() throws Exception {
client.multi();
ListenableFuture<StatusReply> reply = client.pipeline().set("key", "value");
client.exec();
assertEquals("OK",reply.get().data());
}
In RedisClientBase.discard(), the txReplies queue is not cleared. This causes Reply gets to hang on next transaction. For example, testMultiDiscard hangs on the last line of testMultiExec: