[
https://issues.apache.org/jira/browse/HADOOP-9343?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13589656#comment-13589656
]
Todd Lipcon commented on HADOOP-9343:
-------------------------------------
I agree this makes sense (though I didn't look at the patch itself). One thing
I'd add, though, is that we should try to use exceptions less and less over IPC
to communicate important semantic distinctions. I don't know how much it
happens in YARN/MR, but in HDFS there are cases where a call will throw a
ReplicaNotFoundException, which has an important semantic difference from, say,
an IOException that an error occurred.
My reasoning is that, despite our IPC now being reasonably cross-language
capability, exception classes are very much a Java thing. Where possible, we
should instead be using result codes with enums, I think, so that implementors
in other languages don't end up having to do string comparisons against a bunch
of exception types. Using result codes with enums also means that the .proto
files are self-documenting, whereas today the exception types throwable by a
method only live in Java protocol wrappers.
> Allow additional exceptions through the RPC layer
> -------------------------------------------------
>
> Key: HADOOP-9343
> URL: https://issues.apache.org/jira/browse/HADOOP-9343
> Project: Hadoop Common
> Issue Type: Improvement
> Affects Versions: 2.0.3-alpha
> Reporter: Siddharth Seth
> Assignee: Siddharth Seth
> Attachments: HADOOP-9343.txt
>
>
> The RPC layer currently only allows IOException, RuntimeException,
> InterruptedException and their derivatives - which limits exceptions declared
> by protocols.
> Other exceptions end up at the client as an UndeclaredThrowableException
> wrapped in RemoteException.
> Additional exception types should be allowed.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira