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:32:03 UTC

[GitHub] [hadoop] functioner 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

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



##########
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:
       Yes, now I just basically follow the usage of rpcTimeout in the constructor of hadoop.ipc.Client$Connection class.
   However, I think using soTimeout is not suitable (although the value is the same for now), because they should have different meaning.




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