You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2020/11/19 13:27:59 UTC

[GitHub] [ignite] alex-plekhanov commented on a change in pull request #8480: IGNITE-13719 Java thin client: Fix timeout on idle connection

alex-plekhanov commented on a change in pull request #8480:
URL: https://github.com/apache/ignite/pull/8480#discussion_r526878889



##########
File path: modules/core/src/main/java/org/apache/ignite/internal/client/thin/TcpClientChannel.java
##########
@@ -303,7 +312,7 @@ private ClientRequestFuture send(ClientOperation op, Consumer<PayloadOutputChann
     private <T> T receive(ClientRequestFuture pendingReq, Function<PayloadInputChannel, T> payloadReader)
         throws ClientException {
         try {
-            byte[] payload = pendingReq.get();
+            byte[] payload = timeout > 0 ? pendingReq.get(timeout) : pendingReq.get();

Review comment:
       `receiveAsync` calls `get()` on the future only after `pendingReq` completion.
   Also, `CompletableFuture` is returned to the user, so the user can use `get()` method with a timeout to gain the same result.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org