Fixed - RedisTimeoutException arise during blocking command execution on RBlockingQueue and RBlockingDeque objects. #1434

pull/1461/head
Nikita 7 years ago
parent fe79bbf5f2
commit 29dff07e97

@ -726,10 +726,10 @@ public class CommandAsyncService implements CommandAsyncExecutor {
public void run(Timeout timeout) throws Exception {
// re-connection hasn't been made
// and connection is still active
if (orignalChannel == connection.getChannel()
&& connection.isActive()) {
return;
}
// if (orignalChannel == connection.getChannel()
// && connection.isActive()) {
// return;
// }
if (details.getAttemptPromise().trySuccess(null)) {
connection.forceFastReconnectAsync();

@ -11,6 +11,15 @@ import org.redisson.api.RBlockingDeque;
public class RedissonBlockingDequeTest extends BaseTest {
@Test
public void testPollLastAndOfferFirstTo() throws InterruptedException {
RBlockingDeque<String> blockingDeque = redisson.getBlockingDeque("blocking_deque");
long start = System.currentTimeMillis();
String redisTask = blockingDeque.pollLastAndOfferFirstTo("deque", 1, TimeUnit.SECONDS);
assertThat(System.currentTimeMillis() - start).isBetween(950L, 1050L);
assertThat(redisTask).isNull();
}
@Test(timeout = 3000)
public void testShortPoll() throws InterruptedException {
RBlockingDeque<Integer> queue = redisson.getBlockingDeque("queue:pollany");

@ -38,7 +38,7 @@ public class RedissonBlockingQueueTest extends RedissonQueueTest {
return redisson.getBlockingQueue("queue");
}
// @Test
@Test
public void testPollWithBrokenConnection() throws IOException, InterruptedException, ExecutionException {
RedisProcess runner = new RedisRunner()
.nosave()

Loading…
Cancel
Save