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

JobClient.getMapTaskReports on failed job results in NPE

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.23.3
    • Fix Version/s: 3.0.0, 2.0.2-alpha, 0.23.4
    • Component/s: client
    • Labels:
      None

      Description

      When calling JobClient.getMapTaskReports for a job that has failed results in an NPE. For example:

      Exception in thread "main" java.lang.NullPointerException
      	at org.apache.hadoop.mapreduce.counters.AbstractCounters.<init>(AbstractCounters.java:107)
      	at org.apache.hadoop.mapred.Counters.<init>(Counters.java:71)
      	at org.apache.hadoop.mapred.Counters.downgrade(Counters.java:80)
      	at org.apache.hadoop.mapred.TaskReport.downgrade(TaskReport.java:81)
      	at org.apache.hadoop.mapred.TaskReport.downgradeArray(TaskReport.java:88)
      	at org.apache.hadoop.mapred.JobClient.getTaskReports(JobClient.java:691)
      	at org.apache.hadoop.mapred.JobClient.getMapTaskReports(JobClient.java:681)
      ...
      

        Issue Links

          Activity

          Hide
          Hudson added a comment -

          Integrated in Hadoop-Mapreduce-trunk #1211 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/1211/)
          MAPREDUCE-4689. JobClient.getMapTaskReports on failed job results in NPE (jlowe via bobby) (Revision 1391679)

          Result = FAILURE
          bobby : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1391679
          Files :

          • /hadoop/common/trunk/hadoop-mapreduce-project/CHANGES.txt
          • /hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/CompletedTask.java
          • /hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/test/java/org/apache/hadoop/mapreduce/v2/hs/TestJobHistoryParsing.java
          Show
          Hudson added a comment - Integrated in Hadoop-Mapreduce-trunk #1211 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/1211/ ) MAPREDUCE-4689 . JobClient.getMapTaskReports on failed job results in NPE (jlowe via bobby) (Revision 1391679) Result = FAILURE bobby : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1391679 Files : /hadoop/common/trunk/hadoop-mapreduce-project/CHANGES.txt /hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/CompletedTask.java /hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/test/java/org/apache/hadoop/mapreduce/v2/hs/TestJobHistoryParsing.java
          Hide
          Hudson added a comment -

          Integrated in Hadoop-Hdfs-trunk #1180 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/1180/)
          MAPREDUCE-4689. JobClient.getMapTaskReports on failed job results in NPE (jlowe via bobby) (Revision 1391679)

          Result = SUCCESS
          bobby : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1391679
          Files :

          • /hadoop/common/trunk/hadoop-mapreduce-project/CHANGES.txt
          • /hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/CompletedTask.java
          • /hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/test/java/org/apache/hadoop/mapreduce/v2/hs/TestJobHistoryParsing.java
          Show
          Hudson added a comment - Integrated in Hadoop-Hdfs-trunk #1180 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/1180/ ) MAPREDUCE-4689 . JobClient.getMapTaskReports on failed job results in NPE (jlowe via bobby) (Revision 1391679) Result = SUCCESS bobby : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1391679 Files : /hadoop/common/trunk/hadoop-mapreduce-project/CHANGES.txt /hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/CompletedTask.java /hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/test/java/org/apache/hadoop/mapreduce/v2/hs/TestJobHistoryParsing.java
          Hide
          Hudson added a comment -

          Integrated in Hadoop-Hdfs-0.23-Build #389 (See https://builds.apache.org/job/Hadoop-Hdfs-0.23-Build/389/)
          svn merge -c 1391679 FIXES: MAPREDUCE-4689. JobClient.getMapTaskReports on failed job results in NPE (jlowe via bobby) (Revision 1391681)

          Result = UNSTABLE
          bobby : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1391681
          Files :

          • /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/CHANGES.txt
          • /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/CompletedTask.java
          • /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/test/java/org/apache/hadoop/mapreduce/v2/hs/TestJobHistoryParsing.java
          Show
          Hudson added a comment - Integrated in Hadoop-Hdfs-0.23-Build #389 (See https://builds.apache.org/job/Hadoop-Hdfs-0.23-Build/389/ ) svn merge -c 1391679 FIXES: MAPREDUCE-4689 . JobClient.getMapTaskReports on failed job results in NPE (jlowe via bobby) (Revision 1391681) Result = UNSTABLE bobby : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1391681 Files : /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/CHANGES.txt /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/CompletedTask.java /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/test/java/org/apache/hadoop/mapreduce/v2/hs/TestJobHistoryParsing.java
          Hide
          Robert Joseph Evans added a comment -

          Thanks Jason,

          I put this into branch-2, branch-0.23, and trunk

          Show
          Robert Joseph Evans added a comment - Thanks Jason, I put this into branch-2, branch-0.23, and trunk
          Hide
          Hudson added a comment -

          Integrated in Hadoop-Common-trunk-Commit #2786 (See https://builds.apache.org/job/Hadoop-Common-trunk-Commit/2786/)
          MAPREDUCE-4689. JobClient.getMapTaskReports on failed job results in NPE (jlowe via bobby) (Revision 1391679)

          Result = SUCCESS
          bobby : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1391679
          Files :

          • /hadoop/common/trunk/hadoop-mapreduce-project/CHANGES.txt
          • /hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/CompletedTask.java
          • /hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/test/java/org/apache/hadoop/mapreduce/v2/hs/TestJobHistoryParsing.java
          Show
          Hudson added a comment - Integrated in Hadoop-Common-trunk-Commit #2786 (See https://builds.apache.org/job/Hadoop-Common-trunk-Commit/2786/ ) MAPREDUCE-4689 . JobClient.getMapTaskReports on failed job results in NPE (jlowe via bobby) (Revision 1391679) Result = SUCCESS bobby : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1391679 Files : /hadoop/common/trunk/hadoop-mapreduce-project/CHANGES.txt /hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/CompletedTask.java /hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/test/java/org/apache/hadoop/mapreduce/v2/hs/TestJobHistoryParsing.java
          Hide
          Hudson added a comment -

          Integrated in Hadoop-Mapreduce-trunk-Commit #2808 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk-Commit/2808/)
          MAPREDUCE-4689. JobClient.getMapTaskReports on failed job results in NPE (jlowe via bobby) (Revision 1391679)

          Result = FAILURE
          bobby : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1391679
          Files :

          • /hadoop/common/trunk/hadoop-mapreduce-project/CHANGES.txt
          • /hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/CompletedTask.java
          • /hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/test/java/org/apache/hadoop/mapreduce/v2/hs/TestJobHistoryParsing.java
          Show
          Hudson added a comment - Integrated in Hadoop-Mapreduce-trunk-Commit #2808 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk-Commit/2808/ ) MAPREDUCE-4689 . JobClient.getMapTaskReports on failed job results in NPE (jlowe via bobby) (Revision 1391679) Result = FAILURE bobby : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1391679 Files : /hadoop/common/trunk/hadoop-mapreduce-project/CHANGES.txt /hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/CompletedTask.java /hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/test/java/org/apache/hadoop/mapreduce/v2/hs/TestJobHistoryParsing.java
          Hide
          Hudson added a comment -

          Integrated in Hadoop-Hdfs-trunk-Commit #2849 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk-Commit/2849/)
          MAPREDUCE-4689. JobClient.getMapTaskReports on failed job results in NPE (jlowe via bobby) (Revision 1391679)

          Result = SUCCESS
          bobby : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1391679
          Files :

          • /hadoop/common/trunk/hadoop-mapreduce-project/CHANGES.txt
          • /hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/CompletedTask.java
          • /hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/test/java/org/apache/hadoop/mapreduce/v2/hs/TestJobHistoryParsing.java
          Show
          Hudson added a comment - Integrated in Hadoop-Hdfs-trunk-Commit #2849 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk-Commit/2849/ ) MAPREDUCE-4689 . JobClient.getMapTaskReports on failed job results in NPE (jlowe via bobby) (Revision 1391679) Result = SUCCESS bobby : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1391679 Files : /hadoop/common/trunk/hadoop-mapreduce-project/CHANGES.txt /hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/CompletedTask.java /hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/test/java/org/apache/hadoop/mapreduce/v2/hs/TestJobHistoryParsing.java
          Hide
          Jason Lowe added a comment -

          Agreed, this is just to prevent the NPE but doesn't address the larger issue of the counter data being unavailable for failed tasks. Filed MAPREDUCE-4693 to track that issue.

          Show
          Jason Lowe added a comment - Agreed, this is just to prevent the NPE but doesn't address the larger issue of the counter data being unavailable for failed tasks. Filed MAPREDUCE-4693 to track that issue.
          Hide
          Robert Joseph Evans added a comment -

          The patch looks OK to me +1. But this seems more like a band-aide than a full solution. Shouldn't we be returning counters for the failed tasks too, just like the AM does?

          Show
          Robert Joseph Evans added a comment - The patch looks OK to me +1. But this seems more like a band-aide than a full solution. Shouldn't we be returning counters for the failed tasks too, just like the AM does?
          Hide
          Hadoop QA added a comment -

          +1 overall. Here are the results of testing the latest attachment
          http://issues.apache.org/jira/secure/attachment/12547047/MAPREDUCE-4689.patch
          against trunk revision .

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

          +1 tests included. The patch appears to include 1 new or modified test files.

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

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

          +1 eclipse:eclipse. The patch built with eclipse:eclipse.

          +1 findbugs. The patch does not introduce any new Findbugs (version 1.3.9) warnings.

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

          +1 core tests. The patch passed unit tests in hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs.

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

          Test results: https://builds.apache.org/job/PreCommit-MAPREDUCE-Build/2891//testReport/
          Console output: https://builds.apache.org/job/PreCommit-MAPREDUCE-Build/2891//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/12547047/MAPREDUCE-4689.patch against trunk revision . +1 @author . The patch does not contain any @author tags. +1 tests included . The patch appears to include 1 new or modified test files. +1 javac . The applied patch does not increase the total number of javac compiler warnings. +1 javadoc . The javadoc tool did not generate any warning messages. +1 eclipse:eclipse . The patch built with eclipse:eclipse. +1 findbugs . The patch does not introduce any new Findbugs (version 1.3.9) warnings. +1 release audit . The applied patch does not increase the total number of release audit warnings. +1 core tests . The patch passed unit tests in hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs. +1 contrib tests . The patch passed contrib unit tests. Test results: https://builds.apache.org/job/PreCommit-MAPREDUCE-Build/2891//testReport/ Console output: https://builds.apache.org/job/PreCommit-MAPREDUCE-Build/2891//console This message is automatically generated.
          Hide
          Jason Lowe added a comment -

          Patch to CompletedTask so it returns empty counters instead of null counters in the task report.

          In addition to unit test, I also manually tested it with a fail job and verified that JobClient.getMapTaskReports did not throw an NPE when it redirected to the historyserver for the failed job.

          Show
          Jason Lowe added a comment - Patch to CompletedTask so it returns empty counters instead of null counters in the task report. In addition to unit test, I also manually tested it with a fail job and verified that JobClient.getMapTaskReports did not throw an NPE when it redirected to the historyserver for the failed job.
          Hide
          Jason Lowe added a comment -

          The call appears to be fine while the failing job is up and running, but once it moves to the historyserver then it results in the NPE. Apparently the historyserver is returning null for the task Counters when the task has failed, and the client isn't prepared to handle that.

          Show
          Jason Lowe added a comment - The call appears to be fine while the failing job is up and running, but once it moves to the historyserver then it results in the NPE. Apparently the historyserver is returning null for the task Counters when the task has failed, and the client isn't prepared to handle that.

            People

            • Assignee:
              Jason Lowe
              Reporter:
              Jason Lowe
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development