[ 
https://issues.apache.org/jira/browse/HADOOP-5201?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12672609#action_12672609
 ] 

Steve Loughran commented on HADOOP-5201:
----------------------------------------

Marshalling exceptions reliably over the wire is a big problem. All it takes is 
for the code at the far end to have a JDBC driver that throws its own exception 
for you to have something the caller can't understand. There is no way to 
guarantee that someone submitting job has a classpath that matches exactly that 
of the far end. 

If you want to look at the (currently LGPL) code that we use for this, its here:
http://smartfrog.svn.sourceforge.net/viewvc/smartfrog/trunk/core/smartfrog/src/org/smartfrog/sfcore/common/SmartFrogExtractedException.java?view=markup

We run through the entire chain of faults, converting any that arent java.* or 
javax.*, or a subclass of our own types, and extract out all the fault detail; 
all the normal methods are overridden so this extract is not obvious, except of 
course the classname. It is brittle against JVM version (I could throw a an 
exception new to Java5, and against change in our libraries, but we felt it was 
good enough.

I would propose having something like this, which could be used in multiple 
places. Then tweak getDiagnostics() to return a list of events which could be 
strings, exceptions or other useful facts added over time.

> getDiagnostics in TaskReport should return exceptions
> -----------------------------------------------------
>
>                 Key: HADOOP-5201
>                 URL: https://issues.apache.org/jira/browse/HADOOP-5201
>             Project: Hadoop Core
>          Issue Type: Improvement
>          Components: mapred
>            Reporter: Santhosh Srinivasan
>
> Currently, getDiagnostics() returns Strings. When exceptions are thrown in 
> user code and/or Hadoop, it would be cleaner to propagate the exception back 
> to the application for better error handling. Hadoop should return the 
> exceptions instead of returning string representations that correspond to 
> printStackTrace() output.

-- 
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