Uploaded image for project: 'Hadoop YARN'
  1. Hadoop YARN
  2. YARN-1556

NPE getting application report with a null appId

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.7.1
    • Fix Version/s: 2.8.0, 3.0.0-alpha1
    • Component/s: client
    • Labels:
      None

      Description

      If you accidentally pass in a null appId to get application report, you get an NPE back. This is arguably as intended, except that maybe a guard statement could report this in such a way as to make it easy for callers to track down the cause.

      java.lang.NullPointerException: java.lang.NullPointerException
      org.apache.hadoop.ipc.RemoteException(java.lang.NullPointerException): java.lang.NullPointerException
      	at java.util.concurrent.ConcurrentHashMap.hash(ConcurrentHashMap.java:333)
      	at java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:988)
      	at org.apache.hadoop.yarn.server.resourcemanager.ClientRMService.getApplicationReport(ClientRMService.java:243)
      	at org.apache.hadoop.yarn.api.impl.pb.service.ApplicationClientProtocolPBServiceImpl.getApplicationReport(ApplicationClientProtocolPBServiceImpl.java:120)
      	at org.apache.hadoop.yarn.proto.ApplicationClientProtocol$ApplicationClientProtocolService$2.callBlockingMethod(ApplicationClientProtocol.java:241)
      	at org.apache.hadoop.ipc.ProtobufRpcEngine$Server$ProtoBufRpcInvoker.call(ProtobufRpcEngine.java:585)
      	at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:928)
      	at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:2048)
      	at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:2044)
      	at java.security.AccessController.doPrivileged(Native Method)
      	at javax.security.auth.Subject.doAs(Subject.java:415)
      	at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1491)
      	at org.apache.hadoop.ipc.Server$Handler.run(Server.java:2042)
      
      	at org.apache.hadoop.ipc.Client.call(Client.java:1347)
      	at org.apache.hadoop.ipc.Client.call(Client.java:1300)
      	at org.apache.hadoop.ipc.ProtobufRpcEngine$Invoker.invoke(ProtobufRpcEngine.java:206)
      	at com.sun.proxy.$Proxy75.getApplicationReport(Unknown Source)
      	at org.apache.hadoop.yarn.api.impl.pb.client.ApplicationClientProtocolPBClientImpl.getApplicationReport(ApplicationClientProtocolPBClientImpl.java:137)
      	... 28 more
      

        Activity

        Hide
        haosdent@gmail.com haosdent added a comment -

        How about check if the appid is null in getApplicationReport and return a more friendly error message?

        Show
        haosdent@gmail.com haosdent added a comment - How about check if the appid is null in getApplicationReport and return a more friendly error message?
        Hide
        jianhe Jian He added a comment -

        haosdent, sounds good to me, would you like to work on a patch ?

        Show
        jianhe Jian He added a comment - haosdent , sounds good to me, would you like to work on a patch ?
        Hide
        cheersyang Weiwei Yang added a comment -

        I recently run into this problem. So I created a patch to resolve this problem. Please kindly help to review. Thanks.

        Show
        cheersyang Weiwei Yang added a comment - I recently run into this problem. So I created a patch to resolve this problem. Please kindly help to review. Thanks.
        Hide
        hadoopqa Hadoop QA added a comment -



        -1 overall



        Vote Subsystem Runtime Comment
        0 pre-patch 16m 41s Pre-patch trunk compilation is healthy.
        +1 @author 0m 0s The patch does not contain any @author tags.
        +1 tests included 0m 0s The patch appears to include 1 new or modified test files.
        +1 javac 7m 45s There were no new javac warning messages.
        +1 javadoc 9m 54s There were no new javadoc warning messages.
        +1 release audit 0m 23s The applied patch does not increase the total number of release audit warnings.
        +1 checkstyle 0m 51s There were no new checkstyle issues.
        -1 whitespace 0m 0s The patch has 1 line(s) that end in whitespace. Use git apply --whitespace=fix.
        +1 install 1m 32s mvn install still works.
        +1 eclipse:eclipse 0m 33s The patch built with eclipse:eclipse.
        +1 findbugs 1m 27s The patch does not introduce any new Findbugs (version 3.0.0) warnings.
        +1 yarn tests 53m 33s Tests passed in hadoop-yarn-server-resourcemanager.
            92m 44s  



        Subsystem Report/Notes
        Patch URL http://issues.apache.org/jira/secure/attachment/12752960/YARN-1556.patch
        Optional Tests javadoc javac unit findbugs checkstyle
        git revision trunk / e166c03
        whitespace https://builds.apache.org/job/PreCommit-YARN-Build/8933/artifact/patchprocess/whitespace.txt
        hadoop-yarn-server-resourcemanager test log https://builds.apache.org/job/PreCommit-YARN-Build/8933/artifact/patchprocess/testrun_hadoop-yarn-server-resourcemanager.txt
        Test Results https://builds.apache.org/job/PreCommit-YARN-Build/8933/testReport/
        Java 1.7.0_55
        uname Linux asf905.gq1.ygridcore.net 3.13.0-36-lowlatency #63-Ubuntu SMP PREEMPT Wed Sep 3 21:56:12 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
        Console output https://builds.apache.org/job/PreCommit-YARN-Build/8933/console

        This message was automatically generated.

        Show
        hadoopqa Hadoop QA added a comment - -1 overall Vote Subsystem Runtime Comment 0 pre-patch 16m 41s Pre-patch trunk compilation is healthy. +1 @author 0m 0s The patch does not contain any @author tags. +1 tests included 0m 0s The patch appears to include 1 new or modified test files. +1 javac 7m 45s There were no new javac warning messages. +1 javadoc 9m 54s There were no new javadoc warning messages. +1 release audit 0m 23s The applied patch does not increase the total number of release audit warnings. +1 checkstyle 0m 51s There were no new checkstyle issues. -1 whitespace 0m 0s The patch has 1 line(s) that end in whitespace. Use git apply --whitespace=fix. +1 install 1m 32s mvn install still works. +1 eclipse:eclipse 0m 33s The patch built with eclipse:eclipse. +1 findbugs 1m 27s The patch does not introduce any new Findbugs (version 3.0.0) warnings. +1 yarn tests 53m 33s Tests passed in hadoop-yarn-server-resourcemanager.     92m 44s   Subsystem Report/Notes Patch URL http://issues.apache.org/jira/secure/attachment/12752960/YARN-1556.patch Optional Tests javadoc javac unit findbugs checkstyle git revision trunk / e166c03 whitespace https://builds.apache.org/job/PreCommit-YARN-Build/8933/artifact/patchprocess/whitespace.txt hadoop-yarn-server-resourcemanager test log https://builds.apache.org/job/PreCommit-YARN-Build/8933/artifact/patchprocess/testrun_hadoop-yarn-server-resourcemanager.txt Test Results https://builds.apache.org/job/PreCommit-YARN-Build/8933/testReport/ Java 1.7.0_55 uname Linux asf905.gq1.ygridcore.net 3.13.0-36-lowlatency #63-Ubuntu SMP PREEMPT Wed Sep 3 21:56:12 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux Console output https://builds.apache.org/job/PreCommit-YARN-Build/8933/console This message was automatically generated.
        Hide
        djp Junping Du added a comment -

        +1. Patch LGTM. Will fix whitespace issue reported by Mr Jenkins in commit.

        Show
        djp Junping Du added a comment - +1. Patch LGTM. Will fix whitespace issue reported by Mr Jenkins in commit.
        Hide
        djp Junping Du added a comment -

        I have commit the patch to trunk and branch-2. Thanks Steve Loughran for reporting the issue and Weiwei Yang for contributing the patch!

        Show
        djp Junping Du added a comment - I have commit the patch to trunk and branch-2. Thanks Steve Loughran for reporting the issue and Weiwei Yang for contributing the patch!
        Hide
        hudson Hudson added a comment -

        FAILURE: Integrated in Hadoop-trunk-Commit #8363 (See https://builds.apache.org/job/Hadoop-trunk-Commit/8363/)
        YARN-1556. NPE getting application report with a null appId. Contributed by Weiwei Yang. (junping_du: rev beb65c9465806114237aa271b07b31ff3c1f4404)

        • hadoop-yarn-project/CHANGES.txt
        • hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ClientRMService.java
        • hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestClientRMService.java
        Show
        hudson Hudson added a comment - FAILURE: Integrated in Hadoop-trunk-Commit #8363 (See https://builds.apache.org/job/Hadoop-trunk-Commit/8363/ ) YARN-1556 . NPE getting application report with a null appId. Contributed by Weiwei Yang. (junping_du: rev beb65c9465806114237aa271b07b31ff3c1f4404) hadoop-yarn-project/CHANGES.txt hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ClientRMService.java hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestClientRMService.java
        Hide
        hudson Hudson added a comment -

        FAILURE: Integrated in Hadoop-Mapreduce-trunk-Java8 #316 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk-Java8/316/)
        YARN-1556. NPE getting application report with a null appId. Contributed by Weiwei Yang. (junping_du: rev beb65c9465806114237aa271b07b31ff3c1f4404)

        • hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestClientRMService.java
        • hadoop-yarn-project/CHANGES.txt
        • hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ClientRMService.java
        Show
        hudson Hudson added a comment - FAILURE: Integrated in Hadoop-Mapreduce-trunk-Java8 #316 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk-Java8/316/ ) YARN-1556 . NPE getting application report with a null appId. Contributed by Weiwei Yang. (junping_du: rev beb65c9465806114237aa271b07b31ff3c1f4404) hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestClientRMService.java hadoop-yarn-project/CHANGES.txt hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ClientRMService.java
        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Hadoop-Yarn-trunk-Java8 #321 (See https://builds.apache.org/job/Hadoop-Yarn-trunk-Java8/321/)
        YARN-1556. NPE getting application report with a null appId. Contributed by Weiwei Yang. (junping_du: rev beb65c9465806114237aa271b07b31ff3c1f4404)

        • hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ClientRMService.java
        • hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestClientRMService.java
        • hadoop-yarn-project/CHANGES.txt
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Hadoop-Yarn-trunk-Java8 #321 (See https://builds.apache.org/job/Hadoop-Yarn-trunk-Java8/321/ ) YARN-1556 . NPE getting application report with a null appId. Contributed by Weiwei Yang. (junping_du: rev beb65c9465806114237aa271b07b31ff3c1f4404) hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ClientRMService.java hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestClientRMService.java hadoop-yarn-project/CHANGES.txt
        Hide
        hudson Hudson added a comment -

        FAILURE: Integrated in Hadoop-Yarn-trunk #1049 (See https://builds.apache.org/job/Hadoop-Yarn-trunk/1049/)
        YARN-1556. NPE getting application report with a null appId. Contributed by Weiwei Yang. (junping_du: rev beb65c9465806114237aa271b07b31ff3c1f4404)

        • hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestClientRMService.java
        • hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ClientRMService.java
        • hadoop-yarn-project/CHANGES.txt
        Show
        hudson Hudson added a comment - FAILURE: Integrated in Hadoop-Yarn-trunk #1049 (See https://builds.apache.org/job/Hadoop-Yarn-trunk/1049/ ) YARN-1556 . NPE getting application report with a null appId. Contributed by Weiwei Yang. (junping_du: rev beb65c9465806114237aa271b07b31ff3c1f4404) hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestClientRMService.java hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ClientRMService.java hadoop-yarn-project/CHANGES.txt
        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Hadoop-Mapreduce-trunk #2265 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/2265/)
        YARN-1556. NPE getting application report with a null appId. Contributed by Weiwei Yang. (junping_du: rev beb65c9465806114237aa271b07b31ff3c1f4404)

        • hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestClientRMService.java
        • hadoop-yarn-project/CHANGES.txt
        • hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ClientRMService.java
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Hadoop-Mapreduce-trunk #2265 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/2265/ ) YARN-1556 . NPE getting application report with a null appId. Contributed by Weiwei Yang. (junping_du: rev beb65c9465806114237aa271b07b31ff3c1f4404) hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestClientRMService.java hadoop-yarn-project/CHANGES.txt hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ClientRMService.java
        Hide
        hudson Hudson added a comment -

        FAILURE: Integrated in Hadoop-Hdfs-trunk #2246 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/2246/)
        YARN-1556. NPE getting application report with a null appId. Contributed by Weiwei Yang. (junping_du: rev beb65c9465806114237aa271b07b31ff3c1f4404)

        • hadoop-yarn-project/CHANGES.txt
        • hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestClientRMService.java
        • hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ClientRMService.java
        Show
        hudson Hudson added a comment - FAILURE: Integrated in Hadoop-Hdfs-trunk #2246 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/2246/ ) YARN-1556 . NPE getting application report with a null appId. Contributed by Weiwei Yang. (junping_du: rev beb65c9465806114237aa271b07b31ff3c1f4404) hadoop-yarn-project/CHANGES.txt hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestClientRMService.java hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ClientRMService.java
        Hide
        hudson Hudson added a comment -

        FAILURE: Integrated in Hadoop-Hdfs-trunk-Java8 #308 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk-Java8/308/)
        YARN-1556. NPE getting application report with a null appId. Contributed by Weiwei Yang. (junping_du: rev beb65c9465806114237aa271b07b31ff3c1f4404)

        • hadoop-yarn-project/CHANGES.txt
        • hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ClientRMService.java
        • hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestClientRMService.java
        Show
        hudson Hudson added a comment - FAILURE: Integrated in Hadoop-Hdfs-trunk-Java8 #308 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk-Java8/308/ ) YARN-1556 . NPE getting application report with a null appId. Contributed by Weiwei Yang. (junping_du: rev beb65c9465806114237aa271b07b31ff3c1f4404) hadoop-yarn-project/CHANGES.txt hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ClientRMService.java hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestClientRMService.java
        Hide
        cheersyang Weiwei Yang added a comment -

        Thanks Junping Du

        Show
        cheersyang Weiwei Yang added a comment - Thanks Junping Du

          People

          • Assignee:
            cheersyang Weiwei Yang
            Reporter:
            stevel@apache.org Steve Loughran
          • Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development