ferhui commented on a change in pull request #2727:
URL: https://github.com/apache/hadoop/pull/2727#discussion_r584423005



##########
File path: 
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Client.java
##########
@@ -542,8 +542,17 @@ protected PingInputStream(InputStream in) {
        */
       private void handleTimeout(SocketTimeoutException e, int waiting)
           throws IOException {
+        int timeout = 0;
+        if (rpcTimeout > 0) {
+          // effective rpc timeout is rounded up to multiple of pingInterval
+          // if pingInterval < rpcTimeout.
+          timeout = (doPing && pingInterval < rpcTimeout) ?
+              pingInterval : rpcTimeout;
+        } else {
+          timeout = pingInterval;
+        }
         if (shouldCloseConnection.get() || !running.get() ||
-            (0 < rpcTimeout && rpcTimeout <= waiting)) {
+            (timeout <= waiting)) {

Review comment:
       Is your changed code the same as soTimeout <= waiting?




----------------------------------------------------------------
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:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to