[ 
https://issues.apache.org/jira/browse/HADOOP-2841?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Konstantin Shvachko updated HADOOP-2841:
----------------------------------------

    Attachment: getNodeNPE.patch

This patch introduces unwrapping for AccessControlException and 
FileNotFoundException in DFSClient
so that there were no more reason for analyze RemoteException in higher level 
classes.
This was initially submitted under HADOOP-3108.

This patch introduces two unwrapping methods for RemoteException, which unwrap 
and throw original 
exceptions contained inside. There are 2 conditions for successful unwrapping:
# the original exception should be an IOException and
# it should have the default constructors.

Otherwise the RemoteException is re-thrown. 

The first method throws only exceptions of the specified type.
While the second one unwraps anything. The second can be potentially used as a 
generic 
unwrapping method directly inside RPC. For now I use just the first one for 
unwrapping 
AccessControlException and FileNotFoundException exceptions.

More details about the changes are here
http://issues.apache.org/jira/browse/HADOOP-3108#action_12583010

I think this patch is important for 0.17 because currently in many place we 
rely on exception message text
to determine which exception was originally thrown, which imo is a totally 
unacceptable practice.

> Dfs methods should not throw RemoteException
> --------------------------------------------
>
>                 Key: HADOOP-2841
>                 URL: https://issues.apache.org/jira/browse/HADOOP-2841
>             Project: Hadoop Core
>          Issue Type: Improvement
>          Components: dfs
>    Affects Versions: 0.16.0
>            Reporter: Hairong Kuang
>             Fix For: 0.17.0
>
>         Attachments: getNodeNPE.patch
>
>
> Dfs should unwrap the RemoteException and throw the real cause of the error 
> to the user. This allows the user to find out the real cause without 
> examining the remote exception. This also allows the user to use the dfs 
> interface without aware of the implementation details (i.e. rpc).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to