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 "Santhosh Srinivasan (JIRA)" <ji...@apache.org> on 2009/02/09 18:24:59 UTC

[jira] Created: (HADOOP-5201) getDiagnostics in TaskReport should return exceptions

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.


[jira] Commented: (HADOOP-5201) getDiagnostics in TaskReport should return exceptions

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

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

How about we create a specific feature req "create a stable wire format for exceptions" to discuss what we and where it woudl be used

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


[jira] Commented: (HADOOP-5201) getDiagnostics in TaskReport should return exceptions

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

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

I should add that I'd like this feature purely for better logging; no plans to rethrow them. If this is also what Santhosh wants, we don't need to do the tricks of creating a new Throwable chain, just have a general purpose writeable representation of an exception. 

This my SOAP stack equivalent
http://smartfrog.svn.sourceforge.net/viewvc/smartfrog/trunk/projects/alpine/prototype/M32/src/java/org/smartfrog/projects/alpine/faults/

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


[jira] Commented: (HADOOP-5201) getDiagnostics in TaskReport should return exceptions

Posted by "Owen O'Malley (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-5201?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12672190#action_12672190 ] 

Owen O'Malley commented on HADOOP-5201:
---------------------------------------

-1 because we can't guarantee that the exceptions exist in the other context. We could use RemoteException that keeps the class name and exception string separate, but they may not all be exceptions. (The framework can add strings there obviously. I don't remember if it currently does so or not.)

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


[jira] Commented: (HADOOP-5201) getDiagnostics in TaskReport should return exceptions

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

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

Santhosh, are you trying to read the results in and create a new exception at the far end? Does it get thrown? 

I've started a basic writable exception, but not looked at the back-convert to an exception. It's pretty hard to do this well, and I wouldn't attempt to try and create new exceptions of the same classname as before, instead they'd be some wrapper exception that would be trickier to work with. This is the only way to reliably send failures back over the wire without requiring everyone a both ends to have the same set of JARs, all in perfect sync.

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


[jira] Commented: (HADOOP-5201) getDiagnostics in TaskReport should return exceptions

Posted by "Steve Loughran (JIRA)" <ji...@apache.org>.
    [ 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.


[jira] Commented: (HADOOP-5201) getDiagnostics in TaskReport should return exceptions

Posted by "Owen O'Malley (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-5201?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12688043#action_12688043 ] 

Owen O'Malley commented on HADOOP-5201:
---------------------------------------

I'm still -1 on this approach. It would make sense to make RemoteException has a cause that was also a RemoteException. That way if someone (ie. pig) wanted to rebuild the exceptions it would involve less parsing.

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


[jira] Commented: (HADOOP-5201) getDiagnostics in TaskReport should return exceptions

Posted by "Santhosh Srinivasan (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-5201?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12677267#action_12677267 ] 

Santhosh Srinivasan commented on HADOOP-5201:
---------------------------------------------

Another use case: In Hadoop 0.20 there are scenarios where Hadoop returns plain strings with the word error in it instead of throwing an exception or an error. Higher layers cannot work with this, looking at the contents of the string to make sense of what happened.

E.g: Shuffle Error: Exceeded MAX_FAILED_UNIQUE_FETCHES: bailing out

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


[jira] Commented: (HADOOP-5201) getDiagnostics in TaskReport should return exceptions

Posted by "Santhosh Srinivasan (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-5201?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12683104#action_12683104 ] 

Santhosh Srinivasan commented on HADOOP-5201:
---------------------------------------------

Yes, that is exactly what I do. Most of them get thrown. You can look at the source at the following location. In particular look at the method getExceptionFromString

http://svn.apache.org/viewvc/hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/Launcher.java?view=log

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


[jira] Commented: (HADOOP-5201) getDiagnostics in TaskReport should return exceptions

Posted by "Santhosh Srinivasan (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-5201?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12672457#action_12672457 ] 

Santhosh Srinivasan commented on HADOOP-5201:
---------------------------------------------

Let me describe the context of the original request. I am a Pig developer and I need to query exceptions that are thrown by Pig in the runtime envrionment. Since Hadoop does not support the transmission of exceptions on the wire, I had to write methods that recursively recreate the entire exception chain based on the strings sent by Hadoop. It would be far easier if Hadoop can transmit these exceptions.

I do not agree with Owen's comments that exceptions may not exist in the context where they are examined. IMHO, Hadoop should take care of publishing and transmitting the right exceptions making it possible to applications to use the transmitted exception as is.

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


[jira] Commented: (HADOOP-5201) getDiagnostics in TaskReport should return exceptions

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

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

Is there a currently a requirement that the application reading the task report has 100% of all exceptions that may get thrown on the server? If not, you end up with problems at the far end trying to unmarshall something that you can't handle.

This is a recurrent problem in RMI and SOAP stacks, where you get some error message telling you that something went wrong at the far end but they can't tell you what it was. It may be better to serve up some portable summary of the exception (classname, message, stack) without trying to push the full exception over any wire

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


[jira] Commented: (HADOOP-5201) getDiagnostics in TaskReport should return exceptions

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

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

wow, that is a pretty complex bit of reverse-exception parsing. I will put the needs of your code back in to HADOOP-5348

-you want to get the full stack trace details as StackTraceElements
-you use error codes.


Error codes are good for letting code identifying problems without having a vast tree of classes, but there is the risk that you are on the slippery SoapFault road, which started off with an error code and a client/server bit and ended up with a whole chain of user agents. What may be useful is to allow a serializable exception to include a Map<String,String> into which code can add facts (hostname, error code), giving you a class that is extensible when needed, but still easily deserialized.

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


[jira] Commented: (HADOOP-5201) getDiagnostics in TaskReport should return exceptions

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

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

we could make it a list of DiagnosticEvents, which could be simple strings or a fully recursively marshalled exception trace; other events (with toString() methods) could be added later?

Looking at how I handle failures, I do print this out; no attempt is made to understand the text:
{code}
                if (event.getTaskStatus() != TaskCompletionEvent.Status.SUCCEEDED) {
                    String[] diagnostics = runningJob.getTaskDiagnostics(event.getTaskAttemptId());
                    for (String line : diagnostics) {
                        builder.append("\n ");
                        builder.append(line);
                    }
                }
{code}




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