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:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]