Hadoop Common
  1. Hadoop Common
  2. HADOOP-8397

NPE thrown when IPC layer gets an EOF reading a response

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Critical Critical
    • Resolution: Duplicate
    • Affects Version/s: 2.0.0-alpha, 3.0.0
    • Fix Version/s: None
    • Component/s: ipc
    • Labels:
      None
    • Target Version/s:

      Description

      When making a call on an IPC connection where the other end has shut down, I see the following exception:
      Caused by: java.lang.NullPointerException
      at org.apache.hadoop.ipc.Client$Connection.receiveResponse(Client.java:852)
      at org.apache.hadoop.ipc.Client$Connection.run(Client.java:781)
      from the lines:

              RpcResponseHeaderProto response = 
                  RpcResponseHeaderProto.parseDelimitedFrom(in);
              int callId = response.getCallId();
      

      This is because parseDelimitedFrom() returns null in the case that the next thing to be read on the stream is an EOF.

      1. HADOOP-8397.patch
        4 kB
        Vinayakumar B

        Issue Links

          Activity

          Todd Lipcon created issue -
          Hide
          Todd Lipcon added a comment -

          I think we just need to check for a null result, and throw EOFException in that case.

          Show
          Todd Lipcon added a comment - I think we just need to check for a null result, and throw EOFException in that case.
          Uma Maheswara Rao G made changes -
          Field Original Value New Value
          Link This issue is duplicated by HADOOP-8442 [ HADOOP-8442 ]
          Uma Maheswara Rao G made changes -
          Assignee Vinay [ vinayrpet ]
          Vinayakumar B made changes -
          Attachment HADOOP-8397.patch [ 12530541 ]
          Hide
          Vinayakumar B added a comment -

          Attached patch. As suggested by todd just throwing EOFException on null response.

          Show
          Vinayakumar B added a comment - Attached patch. As suggested by todd just throwing EOFException on null response.
          Vinayakumar B made changes -
          Target Version/s 2.0.0-alpha [ 12320352 ] 2.0.0-alpha, 3.0.0 [ 12320352, 12320357 ]
          Affects Version/s 3.0.0 [ 12320357 ]
          Vinayakumar B made changes -
          Status Open [ 1 ] Patch Available [ 10002 ]
          Hadoop Flags Reviewed [ 10343 ]
          Fix Version/s 3.0.0 [ 12320357 ]
          Uma Maheswara Rao G made changes -
          Hadoop Flags Reviewed [ 10343 ]
          Fix Version/s 3.0.0 [ 12320357 ]
          Target Version/s 2.0.0-alpha, 3.0.0 [ 12320352, 12320357 ] 2.0.1-alpha, 3.0.0 [ 12321441, 12320357 ]
          Hide
          Hadoop QA added a comment -

          +1 overall. Here are the results of testing the latest attachment
          http://issues.apache.org/jira/secure/attachment/12530541/HADOOP-8397.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-common-project/hadoop-common.

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

          Test results: https://builds.apache.org/job/PreCommit-HADOOP-Build/1067//testReport/
          Console output: https://builds.apache.org/job/PreCommit-HADOOP-Build/1067//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/12530541/HADOOP-8397.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-common-project/hadoop-common. +1 contrib tests. The patch passed contrib unit tests. Test results: https://builds.apache.org/job/PreCommit-HADOOP-Build/1067//testReport/ Console output: https://builds.apache.org/job/PreCommit-HADOOP-Build/1067//console This message is automatically generated.
          Hide
          Todd Lipcon added a comment -

          +1, looks good. Will commit this momentarily.

          Show
          Todd Lipcon added a comment - +1, looks good. Will commit this momentarily.
          Hide
          Todd Lipcon added a comment -

          Vinay: before I commit, what name would you like listed in the changelog? Just "Contributed by Vinay" or would you like a last name as well?

          Show
          Todd Lipcon added a comment - Vinay: before I commit, what name would you like listed in the changelog? Just "Contributed by Vinay" or would you like a last name as well?
          Hide
          Vinayakumar B added a comment -

          Thanks todd for review. "Contributed by Vinay" is Ok for me.

          Show
          Vinayakumar B added a comment - Thanks todd for review. "Contributed by Vinay" is Ok for me.
          Hide
          Leting Wu added a comment -

          Is this related with only 2.0.0?
          I am using 1.0.3 and when I tried to run a mahout example, I ran into a similar error:

          java.lang.NullPointerException
          	at org.apache.hadoop.ipc.Client$Connection.receiveResponse(Client.java:852)
          	at org.apache.hadoop.ipc.Client$Connection.run(Client.java:781)
          
          Show
          Leting Wu added a comment - Is this related with only 2.0.0? I am using 1.0.3 and when I tried to run a mahout example, I ran into a similar error: java.lang.NullPointerException at org.apache.hadoop.ipc.Client$Connection.receiveResponse(Client.java:852) at org.apache.hadoop.ipc.Client$Connection.run(Client.java:781)
          Hide
          Todd Lipcon added a comment -

          Sorry, I forgot about this one and it looks like the bug got fixed as part of HDFS-3504.

          Show
          Todd Lipcon added a comment - Sorry, I forgot about this one and it looks like the bug got fixed as part of HDFS-3504 .
          Todd Lipcon made changes -
          Status Patch Available [ 10002 ] Resolved [ 5 ]
          Resolution Duplicate [ 3 ]

            People

            • Assignee:
              Vinayakumar B
              Reporter:
              Todd Lipcon
            • Votes:
              0 Vote for this issue
              Watchers:
              11 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development