You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by GitBox <gi...@apache.org> on 2021/03/01 03:25:54 UTC

[GitHub] [hadoop] ferhui commented on a change in pull request #2727: HADOOP-17552. The read method of hadoop.ipc.Client$Connection$PingInputStream may swallow java.net.SocketTimeoutException due to the mistaken usage of the rpcTimeout configuration

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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org