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

NPE in text.encode when writing an invalid(?) JobProfile

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Not A Problem
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      I see an NPE in one of my tests in Text.encode(String), further up the stack is JobProfile.write(), which appears to write a null user

        Activity

        Hide
        Steve Loughran added a comment -

        stack trace. It looks like JobProfile.user is null
        08/09/24 15:28:36 [IPC Server handler 6 on 8012] INFO ipc.Server : IPC Server handler 6 on 8012 caught: java.lang.NullPointerException
        at org.apache.hadoop.io.Text.encode(Text.java:388)
        at org.apache.hadoop.io.Text.encode(Text.java:369)
        at org.apache.hadoop.io.Text.writeString(Text.java:409)
        at org.apache.hadoop.mapred.JobProfile.write(JobProfile.java:165)
        at org.apache.hadoop.io.ObjectWritable.writeObject(ObjectWritable.java:159)
        at org.apache.hadoop.io.ObjectWritable.write(ObjectWritable.java:70)
        at org.apache.hadoop.ipc.Server$Handler.run(Server.java:903)

        Given that the NPE was caught, and throwing an exception is about the only course of action, this could be viewed as working as intended. Alternatively, JobProfile could so some better validation of data and fail with something more meaningful. But is the extra performance hit (and extra test) worth the effort?

        Show
        Steve Loughran added a comment - stack trace. It looks like JobProfile.user is null 08/09/24 15:28:36 [IPC Server handler 6 on 8012] INFO ipc.Server : IPC Server handler 6 on 8012 caught: java.lang.NullPointerException at org.apache.hadoop.io.Text.encode(Text.java:388) at org.apache.hadoop.io.Text.encode(Text.java:369) at org.apache.hadoop.io.Text.writeString(Text.java:409) at org.apache.hadoop.mapred.JobProfile.write(JobProfile.java:165) at org.apache.hadoop.io.ObjectWritable.writeObject(ObjectWritable.java:159) at org.apache.hadoop.io.ObjectWritable.write(ObjectWritable.java:70) at org.apache.hadoop.ipc.Server$Handler.run(Server.java:903) Given that the NPE was caught, and throwing an exception is about the only course of action, this could be viewed as working as intended. Alternatively, JobProfile could so some better validation of data and fail with something more meaningful. But is the extra performance hit (and extra test) worth the effort?
        Hide
        Allen Wittenauer added a comment -

        Probably not.

        Closing as stale.

        Show
        Allen Wittenauer added a comment - Probably not. Closing as stale.

          People

          • Assignee:
            Unassigned
            Reporter:
            Steve Loughran
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development