[ https://issues.apache.org/jira/browse/HDFS-5939?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13906309#comment-13906309 ]
Yongjun Zhang commented on HDFS-5939: ------------------------------------- Hi [~szetszwo], thanks for looking at it further. Given that the chooseRandom method already does {code} if (scope.startsWith(excludedScope)) { return null; } {code} in the beginning, which returns null when "excludedScope" is super set of "scope", and your analysis/observation above for later part of the method that it's possible for numOfDatanode to have value 0. So returning null when numOfDatanode is 0 is consistent with the above piece of code. Based on this info, do you guys agree that my submitted patch is valid? Thanks. > WebHdfs returns misleading error code and logs nothing if trying to create a > file with no DNs in cluster > -------------------------------------------------------------------------------------------------------- > > Key: HDFS-5939 > URL: https://issues.apache.org/jira/browse/HDFS-5939 > Project: Hadoop HDFS > Issue Type: Bug > Components: hdfs-client > Affects Versions: 2.3.0 > Reporter: Yongjun Zhang > Assignee: Yongjun Zhang > Attachments: HDFS-5939.001.patch > > > When trying to access hdfs via webhdfs, and when datanode is dead, user will > see an exception below without any clue that it's caused by dead datanode: > $ curl -i -X PUT > ".../webhdfs/v1/t1?op=CREATE&user.name=<userName>&overwrite=false" > ... > {"RemoteException":{"exception":"IllegalArgumentException","javaClassName":"java.lang.IllegalArgumentException","message":"n > must be positive"}} > Need to fix the report to give user hint about dead datanode. -- This message was sent by Atlassian JIRA (v6.1.5#6160)