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 2019/06/22 01:32:20 UTC

[GitHub] [hadoop] jojochuang commented on a change in pull request #171: HDFS-11227: Set read timeout for peer

jojochuang commented on a change in pull request #171: HDFS-11227: Set read timeout for peer
URL: https://github.com/apache/hadoop/pull/171#discussion_r296429566
 
 

 ##########
 File path: hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/BlockReaderFactory.java
 ##########
 @@ -471,6 +471,10 @@ public ShortCircuitReplicaInfo createShortCircuitReplicaInfo() {
       if (curPeer == null) break;
       if (curPeer.fromCache) remainingCacheTries--;
       DomainPeer peer = (DomainPeer)curPeer.peer;
+      try {
+        peer.setReadTimeout(conf.socketTimeout);
+      }
+      catch(IOException e){}
 
 Review comment:
   According to the javadoc, it should return a null if it is unable to establish a connection. I think it should also return a null in this case as well.

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


With regards,
Apache Git Services

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