Merge pull request #6366 from seakider/fix_responseFuture

Fixed - responseFuture not finished
pull/6367/head
Nikita Koksharov 1 month ago committed by GitHub
commit 694a51af30
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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