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

TaskID default constructor results in NPE on toString()

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.6.0
    • Fix Version/s: 2.9.0, 3.0.0-alpha1
    • Component/s: mrv2
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      This code will reproduce the issue:

      new TaskAttemptID().toString();
      

      The issue is that the default constructor leaves the type null. The get() in CharTaskTypesMaps.getRepresentingCharacter() then throws an NPE on the null type key.

      The simplest solution would be to only call the get() on line 288 of TaskID.java if type is not null and return some other literal otherwise. Since no part of the code is tripping on the NPE, what we choose for the literal shouldn't matter. How about "x"?

        Attachments

          Activity

            People

            • Assignee:
              templedf Daniel Templeton
              Reporter:
              templedf Daniel Templeton
            • Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: