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

NPE in RM while using YarnClient.getApplications()

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.7.2
    • Fix Version/s: 2.9.0, 3.0.0-beta1
    • Component/s: None
    • Labels:

      Description

      java.lang.NullPointerException: java.lang.NullPointerException
      	at org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt.RMAppAttemptMetrics.getAggregateAppResourceUsage(RMAppAttemptMetrics.java:118)
      	at org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt.RMAppAttemptImpl.getApplicationResourceUsageReport(RMAppAttemptImpl.java:857)
      	at org.apache.hadoop.yarn.server.resourcemanager.rmapp.RMAppImpl.createAndGetApplicationReport(RMAppImpl.java:629)
      	at org.apache.hadoop.yarn.server.resourcemanager.ClientRMService.verifyAndCreateAppReport(ClientRMService.java:972)
      	at org.apache.hadoop.yarn.server.resourcemanager.ClientRMService.getApplications(ClientRMService.java:898)
      	at org.apache.hadoop.yarn.server.resourcemanager.ClientRMService.getApplications(ClientRMService.java:734)
      	at org.apache.hadoop.yarn.api.impl.pb.service.ApplicationClientProtocolPBServiceImpl.getApplications(ApplicationClientProtocolPBServiceImpl.java:239)
      	at org.apache.hadoop.yarn.proto.ApplicationClientProtocol$ApplicationClientProtocolService$2.callBlockingMethod(ApplicationClientProtocol.java:441)
      	at org.apache.hadoop.ipc.ProtobufRpcEngine$Server$ProtoBufRpcInvoker.call(ProtobufRpcEngine.java:616)
      	at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:973)
      	at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:2202)
      	at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:2198)
      	at java.security.AccessController.doPrivileged(Native Method)
      	at javax.security.auth.Subject.doAs(Subject.java:422)
      	at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1738)
      	at org.apache.hadoop.ipc.Server$Handler.run(Server.java:2196)
      
      	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
      	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
      	at org.apache.hadoop.yarn.ipc.RPCUtil.instantiateException(RPCUtil.java:53)
      	at org.apache.hadoop.yarn.ipc.RPCUtil.instantiateRuntimeException(RPCUtil.java:85)
      	at org.apache.hadoop.yarn.ipc.RPCUtil.unwrapAndThrowException(RPCUtil.java:122)
      	at org.apache.hadoop.yarn.api.impl.pb.client.ApplicationClientProtocolPBClientImpl.getApplications(ApplicationClientProtocolPBClientImpl.java:254)
      	at sun.reflect.GeneratedMethodAccessor731.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.apache.hadoop.io.retry.RetryInvocationHandler.invokeMethod(RetryInvocationHandler.java:191)
      	at org.apache.hadoop.io.retry.RetryInvocationHandler.invoke(RetryInvocationHandler.java:102)
      	at com.sun.proxy.$Proxy161.getApplications(Unknown Source)
      	at org.apache.hadoop.yarn.client.api.impl.YarnClientImpl.getApplications(YarnClientImpl.java:479)
      	at org.apache.hadoop.yarn.client.api.impl.YarnClientImpl.getApplications(YarnClientImpl.java:456)
      

      When I use YarnClient.getApplications() to get all applications of RM, Occasionally, it throw a NPE problem.

      RMAppAttempt currentAttempt = rmContext.getRMApps()
                         .get(attemptId.getApplicationId()).getCurrentAppAttempt();
      

      if the application id is not in ConcurrentMap<ApplicationId, RMApp> getRMApps(), it may throw NPE problem.

        Activity

        Hide
        hudson Hudson added a comment -

        ABORTED: Integrated in Jenkins build Hadoop-trunk-Commit #12211 (See https://builds.apache.org/job/Hadoop-trunk-Commit/12211/)
        YARN-7007. NPE in RM while using YarnClient.getApplications(). (bibinchundatt: rev e05fa3451db343c0d22496b332910874b6be5b7f)

        • (edit) hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/rmapp/attempt/RMAppAttemptMetrics.java
        Show
        hudson Hudson added a comment - ABORTED: Integrated in Jenkins build Hadoop-trunk-Commit #12211 (See https://builds.apache.org/job/Hadoop-trunk-Commit/12211/ ) YARN-7007 . NPE in RM while using YarnClient.getApplications(). (bibinchundatt: rev e05fa3451db343c0d22496b332910874b6be5b7f) (edit) hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/rmapp/attempt/RMAppAttemptMetrics.java
        Hide
        bibinchundatt Bibin A Chundatt added a comment -

        Thank you Lingfeng Su for contribution.
        Committed to trunk and branch-2

        Show
        bibinchundatt Bibin A Chundatt added a comment - Thank you Lingfeng Su for contribution. Committed to trunk and branch-2
        Hide
        call-fold Lingfeng Su added a comment -
        Show
        call-fold Lingfeng Su added a comment - Thanks, Bibin A Chundatt
        Hide
        bibinchundatt Bibin A Chundatt added a comment -

        The testcase failure is already tracked as part of YARN-7044.
        Current patch looks good to me .. Will commit in soon .

        Show
        bibinchundatt Bibin A Chundatt added a comment - The testcase failure is already tracked as part of YARN-7044 . Current patch looks good to me .. Will commit in soon .
        Hide
        call-fold Lingfeng Su added a comment -

        I met the same problem running junit test, which using the trunk branch of hadoop on github.

        Running org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.TestContainerAllocation
        Tests run: 12, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 46.547 sec <<< FAILURE! - in org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.TestContainerAllocation
        testAMContainerAllocationWhenDNSUnavailable(org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.TestContainerAllocation)  Time elapsed: 30.017 sec  <<< ERROR!
        java.lang.Exception: test timed out after 30000 milliseconds
        	at java.lang.Thread.sleep(Native Method)
        	at org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.TestContainerAllocation.testAMContainerAllocationWhenDNSUnavailable(TestContainerAllocation.java:330)
        
        Show
        call-fold Lingfeng Su added a comment - I met the same problem running junit test, which using the trunk branch of hadoop on github . Running org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.TestContainerAllocation Tests run: 12, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 46.547 sec <<< FAILURE! - in org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.TestContainerAllocation testAMContainerAllocationWhenDNSUnavailable(org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.TestContainerAllocation) Time elapsed: 30.017 sec <<< ERROR! java.lang.Exception: test timed out after 30000 milliseconds at java.lang. Thread .sleep(Native Method) at org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.TestContainerAllocation.testAMContainerAllocationWhenDNSUnavailable(TestContainerAllocation.java:330)
        Hide
        hadoopqa Hadoop QA added a comment -
        -1 overall



        Vote Subsystem Runtime Comment
        0 reexec 0m 23s Docker mode activated.
              Prechecks
        +1 @author 0m 0s The patch does not contain any @author tags.
        -1 test4tests 0m 0s The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.
              trunk Compile Tests
        +1 mvninstall 15m 30s trunk passed
        +1 compile 0m 35s trunk passed
        +1 checkstyle 0m 27s trunk passed
        +1 mvnsite 0m 36s trunk passed
        +1 findbugs 1m 0s trunk passed
        +1 javadoc 0m 22s trunk passed
              Patch Compile Tests
        +1 mvninstall 0m 33s the patch passed
        +1 compile 0m 31s the patch passed
        +1 javac 0m 31s the patch passed
        +1 checkstyle 0m 23s the patch passed
        +1 mvnsite 0m 33s the patch passed
        +1 whitespace 0m 0s The patch has no whitespace issues.
        +1 findbugs 1m 4s the patch passed
        +1 javadoc 0m 19s the patch passed
              Other Tests
        -1 unit 43m 35s hadoop-yarn-server-resourcemanager in the patch failed.
        +1 asflicense 0m 14s The patch does not generate ASF License warnings.
        67m 17s



        Reason Tests
        Failed junit tests hadoop.yarn.server.resourcemanager.scheduler.capacity.TestContainerAllocation



        Subsystem Report/Notes
        Docker Image:yetus/hadoop:14b5c93
        JIRA Issue YARN-7007
        JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12881881/YARN-7007.001.patch
        Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle
        uname Linux dbda4c79e50f 3.13.0-119-generic #166-Ubuntu SMP Wed May 3 12:18:55 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
        Build tool maven
        Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh
        git revision trunk / 645a8f2
        Default Java 1.8.0_144
        findbugs v3.1.0-RC1
        unit https://builds.apache.org/job/PreCommit-YARN-Build/16900/artifact/patchprocess/patch-unit-hadoop-yarn-project_hadoop-yarn_hadoop-yarn-server_hadoop-yarn-server-resourcemanager.txt
        Test Results https://builds.apache.org/job/PreCommit-YARN-Build/16900/testReport/
        modules C: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager U: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager
        Console output https://builds.apache.org/job/PreCommit-YARN-Build/16900/console
        Powered by Apache Yetus 0.6.0-SNAPSHOT http://yetus.apache.org

        This message was automatically generated.

        Show
        hadoopqa Hadoop QA added a comment - -1 overall Vote Subsystem Runtime Comment 0 reexec 0m 23s Docker mode activated.       Prechecks +1 @author 0m 0s The patch does not contain any @author tags. -1 test4tests 0m 0s The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.       trunk Compile Tests +1 mvninstall 15m 30s trunk passed +1 compile 0m 35s trunk passed +1 checkstyle 0m 27s trunk passed +1 mvnsite 0m 36s trunk passed +1 findbugs 1m 0s trunk passed +1 javadoc 0m 22s trunk passed       Patch Compile Tests +1 mvninstall 0m 33s the patch passed +1 compile 0m 31s the patch passed +1 javac 0m 31s the patch passed +1 checkstyle 0m 23s the patch passed +1 mvnsite 0m 33s the patch passed +1 whitespace 0m 0s The patch has no whitespace issues. +1 findbugs 1m 4s the patch passed +1 javadoc 0m 19s the patch passed       Other Tests -1 unit 43m 35s hadoop-yarn-server-resourcemanager in the patch failed. +1 asflicense 0m 14s The patch does not generate ASF License warnings. 67m 17s Reason Tests Failed junit tests hadoop.yarn.server.resourcemanager.scheduler.capacity.TestContainerAllocation Subsystem Report/Notes Docker Image:yetus/hadoop:14b5c93 JIRA Issue YARN-7007 JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12881881/YARN-7007.001.patch Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle uname Linux dbda4c79e50f 3.13.0-119-generic #166-Ubuntu SMP Wed May 3 12:18:55 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux Build tool maven Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh git revision trunk / 645a8f2 Default Java 1.8.0_144 findbugs v3.1.0-RC1 unit https://builds.apache.org/job/PreCommit-YARN-Build/16900/artifact/patchprocess/patch-unit-hadoop-yarn-project_hadoop-yarn_hadoop-yarn-server_hadoop-yarn-server-resourcemanager.txt Test Results https://builds.apache.org/job/PreCommit-YARN-Build/16900/testReport/ modules C: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager U: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager Console output https://builds.apache.org/job/PreCommit-YARN-Build/16900/console Powered by Apache Yetus 0.6.0-SNAPSHOT http://yetus.apache.org This message was automatically generated.
        Hide
        call-fold Lingfeng Su added a comment -

        add a patch, judge if rmApp is null, before getCurrentAppAttempt
        similar to YARN-6801

        Show
        call-fold Lingfeng Su added a comment - add a patch, judge if rmApp is null, before getCurrentAppAttempt similar to YARN-6801
        Hide
        call-fold Lingfeng Su added a comment -

        Thanks, Vrushali C

        Show
        call-fold Lingfeng Su added a comment - Thanks, Vrushali C
        Hide
        vrushalic Vrushali C added a comment -

        HI Lingfeng Su

        I had fixed a similar issue in YARN-6801.

        Show
        vrushalic Vrushali C added a comment - HI Lingfeng Su I had fixed a similar issue in YARN-6801 .
        Hide
        call-fold Lingfeng Su added a comment - - edited

        @Rohith Sharma K S
        I noticed the similar problem in YARN-6847 and YARN-6102, can YARN-6102 solve this problem ?

        Show
        call-fold Lingfeng Su added a comment - - edited @Rohith Sharma K S I noticed the similar problem in YARN-6847 and YARN-6102 , can YARN-6102 solve this problem ?

          People

          • Assignee:
            call-fold Lingfeng Su
            Reporter:
            call-fold Lingfeng Su
          • Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development