Hadoop Map/Reduce
  1. Hadoop Map/Reduce
  2. MAPREDUCE-619

Include more detail in the exception message when a streaming task fails

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: contrib/streaming
    • Labels:
      None

      Description

      When debugging streaming programs, it would be useful to have the last few lines from stderr in the exception message (which is shown in the task's status display).

      1. hadoop-3789-v2.patch
        5 kB
        Tom White
      2. hadoop-3789.patch
        5 kB
        Tom White

        Activity

        Hide
        Tom White added a comment -

        This patch extends PipeMapRed so that when a HadoopStreaming subprocess terminates with a nonzero exit code, and it's recognized as task failure due to stream.non.zero.exit.is.failure, the resulting Java exception carries recent subprocess stderr. "Recent" means more recent than the last "reporter:" line on stderr, limited to a maximum of 2K (configurable)

        Show
        Tom White added a comment - This patch extends PipeMapRed so that when a HadoopStreaming subprocess terminates with a nonzero exit code, and it's recognized as task failure due to stream.non.zero.exit.is.failure, the resulting Java exception carries recent subprocess stderr. "Recent" means more recent than the last "reporter:" line on stderr, limited to a maximum of 2K (configurable)
        Hide
        Tom White added a comment -

        Synced with trunk.

        Show
        Tom White added a comment - Synced with trunk.
        Hide
        Hadoop QA added a comment -

        -1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12387803/hadoop-3789-v2.patch
        against trunk revision 683671.

        +1 @author. The patch does not contain any @author tags.

        -1 tests included. The patch doesn't appear to include any new or modified tests.
        Please justify why no tests are needed for this patch.

        +1 javadoc. The javadoc tool did not generate any warning messages.

        +1 javac. The applied patch does not increase the total number of javac compiler warnings.

        +1 findbugs. The patch does not introduce any new Findbugs warnings.

        +1 release audit. The applied patch does not increase the total number of release audit warnings.

        +1 core tests. The patch passed core unit tests.

        +1 contrib tests. The patch passed contrib unit tests.

        Test results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/3037/testReport/
        Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/3037/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
        Checkstyle results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/3037/artifact/trunk/build/test/checkstyle-errors.html
        Console output: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/3037/console

        This message is automatically generated.

        Show
        Hadoop QA added a comment - -1 overall. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12387803/hadoop-3789-v2.patch against trunk revision 683671. +1 @author. The patch does not contain any @author tags. -1 tests included. The patch doesn't appear to include any new or modified tests. Please justify why no tests are needed for this patch. +1 javadoc. The javadoc tool did not generate any warning messages. +1 javac. The applied patch does not increase the total number of javac compiler warnings. +1 findbugs. The patch does not introduce any new Findbugs warnings. +1 release audit. The applied patch does not increase the total number of release audit warnings. +1 core tests. The patch passed core unit tests. +1 contrib tests. The patch passed contrib unit tests. Test results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/3037/testReport/ Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/3037/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html Checkstyle results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/3037/artifact/trunk/build/test/checkstyle-errors.html Console output: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/3037/console This message is automatically generated.
        Hide
        Chris Douglas added a comment -

        Just a few nits:

        • Instead of stderrStatus.delete(0, stderrStatus.length()), stderrStatus.setLength(0) should do the same thing. The former should just make a call to System.arraycopy- which won't do anything- but the latter is a little more readable.
        • Instead of appending to the buffer and copying over the excess, stderrStatusLimit might be enforced more strictly by doing the length check and delete before the append of lineStr
        • It looks like the buffer size config gets thrown away, instead of being assigned to stderrStatusLimit:
          @@ -122,6 +122,7 @@
                 fs_ = FileSystem.get(job_);
           
                 nonZeroExitIsFailure_ = job_.getBoolean("stream.non.zero.exit.is.failure", true);
          +      job_.getInt("stream.stderr.capture.limit", 2048);
                 
                 doPipe_ = getDoPipe();
                 if (!doPipe_) return;
          
        Show
        Chris Douglas added a comment - Just a few nits: Instead of stderrStatus.delete(0, stderrStatus.length()) , stderrStatus.setLength(0) should do the same thing. The former should just make a call to System.arraycopy- which won't do anything- but the latter is a little more readable. Instead of appending to the buffer and copying over the excess, stderrStatusLimit might be enforced more strictly by doing the length check and delete before the append of lineStr It looks like the buffer size config gets thrown away, instead of being assigned to stderrStatusLimit: @@ -122,6 +122,7 @@ fs_ = FileSystem.get(job_); nonZeroExitIsFailure_ = job_.getBoolean("stream.non.zero.exit.is.failure", true); + job_.getInt("stream.stderr.capture.limit", 2048); doPipe_ = getDoPipe(); if (!doPipe_) return;
        Hide
        Owen O'Malley added a comment -

        Canceling until Chris' comments are addressed.

        Show
        Owen O'Malley added a comment - Canceling until Chris' comments are addressed.

          People

          • Assignee:
            Unassigned
            Reporter:
            Tom White
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:

              Development