Fixed - responseFuture not finished

Signed-off-by: seakider <seakider@gmail.com>
pull/6366/head
seakider 1 month ago
parent 929bfb4616
commit ac44d9df0b

@ -201,7 +201,7 @@ public abstract class BaseRemoteProxy {
List<Result> list = entry.getResponses().get(key);
if (list == null) {
pollResponse();
return null;
return entry;
}
Result res = list.remove(0);

@ -17,6 +17,7 @@ import reactor.core.publisher.Mono;
import java.io.IOException;
import java.io.NotSerializableException;
import java.io.Serializable;
import java.time.Duration;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
@ -919,4 +920,18 @@ public class RedissonRemoteServiceTest extends RedisDockerTest {
r1.shutdown();
r2.shutdown();
}
@Test
public void testDelayMethod() throws InterruptedException {
RedissonClient client = createInstance();
RRemoteService r1 = client.getRemoteService();
r1.register(RemoteInterface.class, new RemoteImpl());
RemoteInvocationOptions options = RemoteInvocationOptions.defaults().noAck().expectResultWithin(1, TimeUnit.SECONDS);
Assertions.assertThrows(RemoteServiceTimeoutException.class, () -> r1.get(RemoteInterface.class, options).timeoutMethod());
RFuture<Void> future = r1.get(RemoteInterfaceAsync.class, options).timeoutMethod();
Thread.sleep(3000);
assertThat(future.isDone()).isEqualTo(true);
}
}

Loading…
Cancel
Save