Uploaded image for project: 'Hadoop Map/Reduce'
  1. Hadoop Map/Reduce
  2. MAPREDUCE-6110

JobHistoryServer CLI throws NullPointerException with job ids that do not exist

    XMLWordPrintableJSON

Details

    • Reviewed

    Description

      When using JobHistoryServer CLI to query a job id that does not exist on the server, it may throw NullPointerException sometimes.

      I tried "mapred job -events <some_wrong_jobId> 0 100", and the result was:

      Exception in thread "main" java.lang.NullPointerException
      at org.apache.hadoop.mapreduce.tools.CLI.listEvents(CLI.java:487)
      at org.apache.hadoop.mapreduce.tools.CLI.run(CLI.java:316)
      at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
      at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:84)
      at org.apache.hadoop.mapred.JobClient.main(JobClient.java:1237)

      Similar symptoms also appear with -list-attempt-ids, but were fine with -status and -set-priority.

      I traced back to CLI.listEvents, and line 487 is:

      TaskCompletionEvent[] events = job.
            getTaskCompletionEvents(fromEventId, numEvents);
      

      The job object is obtained from JobID.forName(jobid)) (line 316), which will return null if the job does not exist on server.

      Maybe we want to have some behaviors consistent with -status here, by simply reporting jobId does not exist?

      Attachments

        1. MAPREDUCE-6110.03.patch
          6 kB
          Kai
        2. MAPREDUCE-6110.02.patch
          4 kB
          Kai
        3. MAPREDUCE-6110.01.patch
          4 kB
          Kai

        Activity

          People

            lewuathe Kai
            gtcarrera9 Li Lu
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: