[
https://issues.apache.org/jira/browse/HDFS-5939?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13907308#comment-13907308
]
Yongjun Zhang commented on HDFS-5939:
-------------------------------------
Thanks Haohui.
I had one thought, I wonder why method RuntimeException.unwrapRemoteException
only assume the wrapped exception class to be of subclasses of IOExceptoin. I
kind of assumed there may be a good reason behind it yesterday. But thinking
about it a bit more, why can't we also let it also deal with RuntimeException?
I will give it a try later today too. Do you agree?
About your first comment, first of all, In production, it's an error that user
need to deal with I think. Secondly, I want to be able to find out exactly
what's the reason of exception at the unit test side, and claim success if it's
because of no datanode. If we throw an IOException, I can't be sure whether my
unit test is successful or not. That's why I had the NoDatanodeException. Of
course, I can try to see if there is "no datanode" string in the exception's
message. But what about if there is other IOException thrown and it also has
the "no datanode" message.
I put the above comments for discussion purpose. I think if I can make
InvalidTopologyException work, then it should be good. Would you please confirm
if you agree that we can try to make RuntimeException.unwrapRemoteException to
handle RuntimeException?
I'm on something else now and I will address your second comment a bit later
today.
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, HDFS-5939.002.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)