You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-dev@hadoop.apache.org by "Sanjay Radia (JIRA)" <ji...@apache.org> on 2008/08/23 02:00:44 UTC

[jira] Created: (HADOOP-4009) Declare HDFS exceptions in the HDFS interface and also in class FileSystem and rethrow the encapsulated exception

Declare HDFS exceptions in the HDFS interface and also in class FileSystem and rethrow the encapsulated exception
-----------------------------------------------------------------------------------------------------------------

                 Key: HADOOP-4009
                 URL: https://issues.apache.org/jira/browse/HADOOP-4009
             Project: Hadoop Core
          Issue Type: Sub-task
            Reporter: Sanjay Radia


Server-side exceptions are encapsulated in the remote exception (as  the class name and the error string ).
The client side and FileSystem does not declare or thrown the these encapsulated exception.

Work Items
 * Declare the exceptions in FileSystem and the HDFS interface (but still as subclasses of IOException)
 * Rethrow encapsulated declared exceptions if they are the declared exception.

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


[jira] Commented: (HADOOP-4009) Declare HDFS exceptions in the HDFS interface and also in class FileSystem and rethrow the encapsulated exception

Posted by "Steve Loughran (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-4009?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12625207#action_12625207 ] 

Steve Loughran commented on HADOOP-4009:
----------------------------------------

-you could search the code for  the string "catch(RemoteException" and see what comes up. One of the real risks here is that its the failure mode code that is being changed, and that's always the code that doesn't get enough coverage, enough testing and enough real-world use, because its not until things start to go wrong in interesting ways that the code gets followed. Which makes it harder to say "we've fixed everything" once this change (Which seems good, BTW).

One possibility: make the HDFS exception a subclass of RemoteException, with all the existing semantics. Old code may still work.

> Declare HDFS exceptions in the HDFS interface and also in class FileSystem and rethrow the encapsulated exception
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: HADOOP-4009
>                 URL: https://issues.apache.org/jira/browse/HADOOP-4009
>             Project: Hadoop Core
>          Issue Type: Sub-task
>            Reporter: Sanjay Radia
>
> Server-side exceptions are encapsulated in the remote exception (as  the class name and the error string ).
> The client side and FileSystem does not declare or thrown the these encapsulated exception.
> Work Items
>  * Declare the exceptions in FileSystem and the HDFS interface (but still as subclasses of IOException)
>  * Rethrow encapsulated declared exceptions if they are the declared exception.

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


[jira] Commented: (HADOOP-4009) Declare HDFS exceptions in the HDFS interface and also in class FileSystem and rethrow the encapsulated exception

Posted by "Tsz Wo (Nicholas), SZE (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-4009?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12625576#action_12625576 ] 

Tsz Wo (Nicholas), SZE commented on HADOOP-4009:
------------------------------------------------

> Unfortunately, this may endup throwing exceptions not declared in the signature.

It is not possible since the program won't be compiled.

> One must rethrow the deepest declared exception

Should it rethrow the *original/wrapped* exception?  In the example "foo() throws A, Ab, Ac", if server throws Abb which is a subclass of Ab.  I think we should throw Abb but not Ab.

> Declare HDFS exceptions in the HDFS interface and also in class FileSystem and rethrow the encapsulated exception
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: HADOOP-4009
>                 URL: https://issues.apache.org/jira/browse/HADOOP-4009
>             Project: Hadoop Core
>          Issue Type: Sub-task
>            Reporter: Sanjay Radia
>
> Server-side exceptions are encapsulated in the remote exception (as  the class name and the error string ).
> The client side and FileSystem does not declare or thrown the these encapsulated exception.
> Work Items
>  * Declare the exceptions in FileSystem and the HDFS interface (but still as subclasses of IOException)
>  * Rethrow encapsulated declared exceptions if they are the declared exception.

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


[jira] Updated: (HADOOP-4009) Declare HDFS exceptions in the HDFS interface and also in class FileSystem and rethrow the encapsulated exception

Posted by "Robert Chansler (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-4009?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Robert Chansler updated HADOOP-4009:
------------------------------------

    Component/s: dfs

> Declare HDFS exceptions in the HDFS interface and also in class FileSystem and rethrow the encapsulated exception
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: HADOOP-4009
>                 URL: https://issues.apache.org/jira/browse/HADOOP-4009
>             Project: Hadoop Core
>          Issue Type: Sub-task
>          Components: dfs
>            Reporter: Sanjay Radia
>
> Server-side exceptions are encapsulated in the remote exception (as  the class name and the error string ).
> The client side and FileSystem does not declare or thrown the these encapsulated exception.
> Work Items
>  * Declare the exceptions in FileSystem and the HDFS interface (but still as subclasses of IOException)
>  * Rethrow encapsulated declared exceptions if they are the declared exception.

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


[jira] Commented: (HADOOP-4009) Declare HDFS exceptions in the HDFS interface and also in class FileSystem and rethrow the encapsulated exception

Posted by "Sanjay Radia (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-4009?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12625569#action_12625569 ] 

Sanjay Radia commented on HADOOP-4009:
--------------------------------------

Here are two possible solutions that can be implemented in the RPC layer.
1) if the client side has the class of the wrapped exception then rethrow it
    Unfortunately, this may endup throwing exceptions not declared in the signature.

2) if the client side has the class of the wrapped exception and it is a declared exception then rethrow it.
   One must rethrow the *deepest* declared exception (since a method could declare multiple exceptions that are 
   a subclass of one of the declared exception.)
    Q. suppose method foo() is declared as: foo() throws A, Ab, Ac;
   and Ab and Ac are subclasses of A.
   Say the server throws Az which is a subclass of A (note Az is not declared in foo's signature).
   Should the client side rethrow Az or A assuming that the class for Az is available?



> Declare HDFS exceptions in the HDFS interface and also in class FileSystem and rethrow the encapsulated exception
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: HADOOP-4009
>                 URL: https://issues.apache.org/jira/browse/HADOOP-4009
>             Project: Hadoop Core
>          Issue Type: Sub-task
>            Reporter: Sanjay Radia
>
> Server-side exceptions are encapsulated in the remote exception (as  the class name and the error string ).
> The client side and FileSystem does not declare or thrown the these encapsulated exception.
> Work Items
>  * Declare the exceptions in FileSystem and the HDFS interface (but still as subclasses of IOException)
>  * Rethrow encapsulated declared exceptions if they are the declared exception.

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


[jira] Commented: (HADOOP-4009) Declare HDFS exceptions in the HDFS interface and also in class FileSystem and rethrow the encapsulated exception

Posted by "Konstantin Shvachko (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-4009?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12625005#action_12625005 ] 

Konstantin Shvachko commented on HADOOP-4009:
---------------------------------------------

Re-throwing should be rather easy since we have {{unwrapRemoteException()}}. 
But catching and analyzing the "real" exceptions instead of {{RemoteException}} as we do now will involve a lot of code changes.

> Declare HDFS exceptions in the HDFS interface and also in class FileSystem and rethrow the encapsulated exception
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: HADOOP-4009
>                 URL: https://issues.apache.org/jira/browse/HADOOP-4009
>             Project: Hadoop Core
>          Issue Type: Sub-task
>            Reporter: Sanjay Radia
>
> Server-side exceptions are encapsulated in the remote exception (as  the class name and the error string ).
> The client side and FileSystem does not declare or thrown the these encapsulated exception.
> Work Items
>  * Declare the exceptions in FileSystem and the HDFS interface (but still as subclasses of IOException)
>  * Rethrow encapsulated declared exceptions if they are the declared exception.

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