[ 
https://issues.apache.org/jira/browse/HDFS-11395?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15877571#comment-15877571
 ] 

Nandakumar commented on HDFS-11395:
-----------------------------------

Thanks for the review [~arpitagarwal].

The HDFS clients expect unwrapped remote exception (like FileNotFoundException, 
AccessControlException, UnresolvedPathException).
Unwrapping of remote exception is done in {{DFSClient}}, {{DFSOutputStream}}, 
etc..

For example
{code:title=DFSClient#callGetBlockLocations}
static LocatedBlocks callGetBlockLocations(ClientProtocol namenode,
      String src, long start, long length) 
      throws IOException {
    try {
      return namenode.getBlockLocations(src, start, length);
    } catch(RemoteException re) {
      throw re.unwrapRemoteException(AccessControlException.class,
                                     FileNotFoundException.class,
                                     UnresolvedPathException.class);
    }
{code}

If we throw {{MultiException(RemoteException(Exception1), 
RemoteException(Exception2))}} from RequestHedgingInvocationHandler, unwrapping 
will not be done (by DFSClient, DFSOutputStream, etc.. the catch block doesn't 
handle MultiException) and the hdfs clients will directly receive 
MultiException.

The hdfs clients (like hbase, hive, user applications) have no idea on how to 
handle MultiException. 

> RequestHedgingProxyProvider#RequestHedgingInvocationHandler hides the 
> Exception thrown from NameNode
> ----------------------------------------------------------------------------------------------------
>
>                 Key: HDFS-11395
>                 URL: https://issues.apache.org/jira/browse/HDFS-11395
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: ha
>            Reporter: Nandakumar
>            Assignee: Nandakumar
>         Attachments: HDFS-11395.000.patch
>
>
> When using RequestHedgingProxyProvider, in case of Exception (like 
> FileNotFoundException) from ActiveNameNode, 
> {{RequestHedgingProxyProvider#RequestHedgingInvocationHandler.invoke}} 
> receives {{ExecutionException}} since we use {{CompletionService}} for the 
> call. The ExecutionException is put into a map and wrapped with 
> {{MultiException}}.
> So for a FileNotFoundException the client receives 
> {{MultiException(Map(ExecutionException(InvocationTargetException(RemoteException(FileNotFoundException)))))}}
> It will cause problem in clients which are handling RemoteExceptions.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org

Reply via email to