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

Make RegisterNodeManagerRequestPBImpl thread-safe

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.8.0
    • Fix Version/s: 2.9.0, 3.0.0-alpha1
    • Component/s: nodemanager
    • Labels:
      None
    • Target Version/s:

      Description

      While working on YARN-4512, I noticed there are potential race conditions in RegisterNodeManagerRequestPBImpl. We need to add more locking.

      1. yarn-4647.001.patch
        8 kB
        Karthik Kambatla
      2. yarn-4647.002.patch
        8 kB
        Karthik Kambatla

        Issue Links

          Activity

          Hide
          kasha Karthik Kambatla added a comment -

          Thanks for the review, Wangda. Just committed this to trunk and branch-2.

          Show
          kasha Karthik Kambatla added a comment - Thanks for the review, Wangda. Just committed this to trunk and branch-2.
          Hide
          hudson Hudson added a comment -

          FAILURE: Integrated in Hadoop-trunk-Commit #9209 (See https://builds.apache.org/job/Hadoop-trunk-Commit/9209/)
          YARN-4647. Make RegisterNodeManagerRequestPBImpl thread-safe. (kasha) (kasha: rev c9a09d6926b258e205a4ff7998ce5a86bf5dbe3b)

          • hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/impl/pb/RegisterNodeManagerRequestPBImpl.java
          • hadoop-yarn-project/CHANGES.txt
          Show
          hudson Hudson added a comment - FAILURE: Integrated in Hadoop-trunk-Commit #9209 (See https://builds.apache.org/job/Hadoop-trunk-Commit/9209/ ) YARN-4647 . Make RegisterNodeManagerRequestPBImpl thread-safe. (kasha) (kasha: rev c9a09d6926b258e205a4ff7998ce5a86bf5dbe3b) hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/impl/pb/RegisterNodeManagerRequestPBImpl.java hadoop-yarn-project/CHANGES.txt
          Hide
          kasha Karthik Kambatla added a comment -

          The checkstyle errors are benign. No unit test since the patch only adds synchronization.

          Checking this in, based on Wangda's +1 earlier.

          Show
          kasha Karthik Kambatla added a comment - The checkstyle errors are benign. No unit test since the patch only adds synchronization. Checking this in, based on Wangda's +1 earlier.
          Hide
          hadoopqa Hadoop QA added a comment -
          -1 overall



          Vote Subsystem Runtime Comment
          0 reexec 0m 0s Docker mode activated.
          +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.
          +1 mvninstall 7m 35s trunk passed
          +1 compile 0m 18s trunk passed with JDK v1.8.0_66
          +1 compile 0m 20s trunk passed with JDK v1.7.0_91
          +1 checkstyle 0m 17s trunk passed
          +1 mvnsite 0m 26s trunk passed
          +1 mvneclipse 0m 13s trunk passed
          +1 findbugs 0m 54s trunk passed
          +1 javadoc 0m 23s trunk passed with JDK v1.8.0_66
          +1 javadoc 0m 25s trunk passed with JDK v1.7.0_91
          +1 mvninstall 0m 20s the patch passed
          +1 compile 0m 16s the patch passed with JDK v1.8.0_66
          +1 javac 0m 16s the patch passed
          +1 compile 0m 18s the patch passed with JDK v1.7.0_91
          +1 javac 0m 18s the patch passed
          -1 checkstyle 0m 13s hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common: patch generated 2 new + 10 unchanged - 6 fixed = 12 total (was 16)
          +1 mvnsite 0m 24s the patch passed
          +1 mvneclipse 0m 13s the patch passed
          +1 whitespace 0m 0s Patch has no whitespace issues.
          +1 findbugs 1m 1s the patch passed
          +1 javadoc 0m 19s the patch passed with JDK v1.8.0_66
          +1 javadoc 0m 23s the patch passed with JDK v1.7.0_91
          +1 unit 0m 23s hadoop-yarn-server-common in the patch passed with JDK v1.8.0_66.
          +1 unit 0m 26s hadoop-yarn-server-common in the patch passed with JDK v1.7.0_91.
          +1 asflicense 0m 20s Patch does not generate ASF License warnings.
          16m 44s



          Subsystem Report/Notes
          Docker Image:yetus/hadoop:0ca8df7
          JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12785054/yarn-4647.002.patch
          JIRA Issue YARN-4647
          Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle
          uname Linux 9ee9aa8e3662 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
          Build tool maven
          Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh
          git revision trunk / 7f46636
          Default Java 1.7.0_91
          Multi-JDK versions /usr/lib/jvm/java-8-oracle:1.8.0_66 /usr/lib/jvm/java-7-openjdk-amd64:1.7.0_91
          findbugs v3.0.0
          checkstyle https://builds.apache.org/job/PreCommit-YARN-Build/10427/artifact/patchprocess/diff-checkstyle-hadoop-yarn-project_hadoop-yarn_hadoop-yarn-server_hadoop-yarn-server-common.txt
          JDK v1.7.0_91 Test Results https://builds.apache.org/job/PreCommit-YARN-Build/10427/testReport/
          modules C: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common U: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common
          Max memory used 76MB
          Powered by Apache Yetus 0.2.0-SNAPSHOT http://yetus.apache.org
          Console output https://builds.apache.org/job/PreCommit-YARN-Build/10427/console

          This message was automatically generated.

          Show
          hadoopqa Hadoop QA added a comment - -1 overall Vote Subsystem Runtime Comment 0 reexec 0m 0s Docker mode activated. +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. +1 mvninstall 7m 35s trunk passed +1 compile 0m 18s trunk passed with JDK v1.8.0_66 +1 compile 0m 20s trunk passed with JDK v1.7.0_91 +1 checkstyle 0m 17s trunk passed +1 mvnsite 0m 26s trunk passed +1 mvneclipse 0m 13s trunk passed +1 findbugs 0m 54s trunk passed +1 javadoc 0m 23s trunk passed with JDK v1.8.0_66 +1 javadoc 0m 25s trunk passed with JDK v1.7.0_91 +1 mvninstall 0m 20s the patch passed +1 compile 0m 16s the patch passed with JDK v1.8.0_66 +1 javac 0m 16s the patch passed +1 compile 0m 18s the patch passed with JDK v1.7.0_91 +1 javac 0m 18s the patch passed -1 checkstyle 0m 13s hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common: patch generated 2 new + 10 unchanged - 6 fixed = 12 total (was 16) +1 mvnsite 0m 24s the patch passed +1 mvneclipse 0m 13s the patch passed +1 whitespace 0m 0s Patch has no whitespace issues. +1 findbugs 1m 1s the patch passed +1 javadoc 0m 19s the patch passed with JDK v1.8.0_66 +1 javadoc 0m 23s the patch passed with JDK v1.7.0_91 +1 unit 0m 23s hadoop-yarn-server-common in the patch passed with JDK v1.8.0_66. +1 unit 0m 26s hadoop-yarn-server-common in the patch passed with JDK v1.7.0_91. +1 asflicense 0m 20s Patch does not generate ASF License warnings. 16m 44s Subsystem Report/Notes Docker Image:yetus/hadoop:0ca8df7 JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12785054/yarn-4647.002.patch JIRA Issue YARN-4647 Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle uname Linux 9ee9aa8e3662 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 Build tool maven Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh git revision trunk / 7f46636 Default Java 1.7.0_91 Multi-JDK versions /usr/lib/jvm/java-8-oracle:1.8.0_66 /usr/lib/jvm/java-7-openjdk-amd64:1.7.0_91 findbugs v3.0.0 checkstyle https://builds.apache.org/job/PreCommit-YARN-Build/10427/artifact/patchprocess/diff-checkstyle-hadoop-yarn-project_hadoop-yarn_hadoop-yarn-server_hadoop-yarn-server-common.txt JDK v1.7.0_91 Test Results https://builds.apache.org/job/PreCommit-YARN-Build/10427/testReport/ modules C: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common U: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common Max memory used 76MB Powered by Apache Yetus 0.2.0-SNAPSHOT http://yetus.apache.org Console output https://builds.apache.org/job/PreCommit-YARN-Build/10427/console This message was automatically generated.
          Hide
          kasha Karthik Kambatla added a comment -

          Oh missed the synchronization on getProto. Updated patch takes care of that too.

          Show
          kasha Karthik Kambatla added a comment - Oh missed the synchronization on getProto. Updated patch takes care of that too.
          Hide
          hadoopqa Hadoop QA added a comment -
          -1 overall



          Vote Subsystem Runtime Comment
          0 reexec 0m 0s Docker mode activated.
          +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.
          +1 mvninstall 6m 57s trunk passed
          +1 compile 0m 15s trunk passed with JDK v1.8.0_66
          +1 compile 0m 18s trunk passed with JDK v1.7.0_91
          +1 checkstyle 0m 14s trunk passed
          +1 mvnsite 0m 22s trunk passed
          +1 mvneclipse 0m 12s trunk passed
          +1 findbugs 0m 45s trunk passed
          +1 javadoc 0m 20s trunk passed with JDK v1.8.0_66
          +1 javadoc 0m 21s trunk passed with JDK v1.7.0_91
          +1 mvninstall 0m 18s the patch passed
          +1 compile 0m 16s the patch passed with JDK v1.8.0_66
          +1 javac 0m 16s the patch passed
          +1 compile 0m 16s the patch passed with JDK v1.7.0_91
          +1 javac 0m 16s the patch passed
          -1 checkstyle 0m 11s hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common: patch generated 2 new + 10 unchanged - 6 fixed = 12 total (was 16)
          +1 mvnsite 0m 20s the patch passed
          +1 mvneclipse 0m 10s the patch passed
          +1 whitespace 0m 0s Patch has no whitespace issues.
          -1 findbugs 0m 57s hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common generated 3 new + 0 unchanged - 0 fixed = 3 total (was 0)
          +1 javadoc 0m 16s the patch passed with JDK v1.8.0_66
          +1 javadoc 0m 19s the patch passed with JDK v1.7.0_91
          +1 unit 0m 19s hadoop-yarn-server-common in the patch passed with JDK v1.8.0_66.
          +1 unit 0m 23s hadoop-yarn-server-common in the patch passed with JDK v1.7.0_91.
          +1 asflicense 0m 19s Patch does not generate ASF License warnings.
          14m 53s



          Reason Tests
          FindBugs module:hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common
            Inconsistent synchronization of org.apache.hadoop.yarn.server.api.protocolrecords.impl.pb.RegisterNodeManagerRequestPBImpl.builder; locked 95% of time Unsynchronized access at RegisterNodeManagerRequestPBImpl.java:95% of time Unsynchronized access at RegisterNodeManagerRequestPBImpl.java:[line 70]
            Inconsistent synchronization of org.apache.hadoop.yarn.server.api.protocolrecords.impl.pb.RegisterNodeManagerRequestPBImpl.proto; locked 75% of time Unsynchronized access at RegisterNodeManagerRequestPBImpl.java:75% of time Unsynchronized access at RegisterNodeManagerRequestPBImpl.java:[line 70]
            Inconsistent synchronization of org.apache.hadoop.yarn.server.api.protocolrecords.impl.pb.RegisterNodeManagerRequestPBImpl.viaProto; locked 84% of time Unsynchronized access at RegisterNodeManagerRequestPBImpl.java:84% of time Unsynchronized access at RegisterNodeManagerRequestPBImpl.java:[line 70]



          Subsystem Report/Notes
          Docker Image:yetus/hadoop:0ca8df7
          JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12784704/yarn-4647.001.patch
          JIRA Issue YARN-4647
          Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle
          uname Linux 01ba86c9cf5a 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
          Build tool maven
          Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh
          git revision trunk / 662e17b
          Default Java 1.7.0_91
          Multi-JDK versions /usr/lib/jvm/java-8-oracle:1.8.0_66 /usr/lib/jvm/java-7-openjdk-amd64:1.7.0_91
          findbugs v3.0.0
          checkstyle https://builds.apache.org/job/PreCommit-YARN-Build/10416/artifact/patchprocess/diff-checkstyle-hadoop-yarn-project_hadoop-yarn_hadoop-yarn-server_hadoop-yarn-server-common.txt
          findbugs https://builds.apache.org/job/PreCommit-YARN-Build/10416/artifact/patchprocess/new-findbugs-hadoop-yarn-project_hadoop-yarn_hadoop-yarn-server_hadoop-yarn-server-common.html
          JDK v1.7.0_91 Test Results https://builds.apache.org/job/PreCommit-YARN-Build/10416/testReport/
          modules C: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common U: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common
          Max memory used 76MB
          Powered by Apache Yetus 0.2.0-SNAPSHOT http://yetus.apache.org
          Console output https://builds.apache.org/job/PreCommit-YARN-Build/10416/console

          This message was automatically generated.

          Show
          hadoopqa Hadoop QA added a comment - -1 overall Vote Subsystem Runtime Comment 0 reexec 0m 0s Docker mode activated. +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. +1 mvninstall 6m 57s trunk passed +1 compile 0m 15s trunk passed with JDK v1.8.0_66 +1 compile 0m 18s trunk passed with JDK v1.7.0_91 +1 checkstyle 0m 14s trunk passed +1 mvnsite 0m 22s trunk passed +1 mvneclipse 0m 12s trunk passed +1 findbugs 0m 45s trunk passed +1 javadoc 0m 20s trunk passed with JDK v1.8.0_66 +1 javadoc 0m 21s trunk passed with JDK v1.7.0_91 +1 mvninstall 0m 18s the patch passed +1 compile 0m 16s the patch passed with JDK v1.8.0_66 +1 javac 0m 16s the patch passed +1 compile 0m 16s the patch passed with JDK v1.7.0_91 +1 javac 0m 16s the patch passed -1 checkstyle 0m 11s hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common: patch generated 2 new + 10 unchanged - 6 fixed = 12 total (was 16) +1 mvnsite 0m 20s the patch passed +1 mvneclipse 0m 10s the patch passed +1 whitespace 0m 0s Patch has no whitespace issues. -1 findbugs 0m 57s hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common generated 3 new + 0 unchanged - 0 fixed = 3 total (was 0) +1 javadoc 0m 16s the patch passed with JDK v1.8.0_66 +1 javadoc 0m 19s the patch passed with JDK v1.7.0_91 +1 unit 0m 19s hadoop-yarn-server-common in the patch passed with JDK v1.8.0_66. +1 unit 0m 23s hadoop-yarn-server-common in the patch passed with JDK v1.7.0_91. +1 asflicense 0m 19s Patch does not generate ASF License warnings. 14m 53s Reason Tests FindBugs module:hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common   Inconsistent synchronization of org.apache.hadoop.yarn.server.api.protocolrecords.impl.pb.RegisterNodeManagerRequestPBImpl.builder; locked 95% of time Unsynchronized access at RegisterNodeManagerRequestPBImpl.java:95% of time Unsynchronized access at RegisterNodeManagerRequestPBImpl.java: [line 70]   Inconsistent synchronization of org.apache.hadoop.yarn.server.api.protocolrecords.impl.pb.RegisterNodeManagerRequestPBImpl.proto; locked 75% of time Unsynchronized access at RegisterNodeManagerRequestPBImpl.java:75% of time Unsynchronized access at RegisterNodeManagerRequestPBImpl.java: [line 70]   Inconsistent synchronization of org.apache.hadoop.yarn.server.api.protocolrecords.impl.pb.RegisterNodeManagerRequestPBImpl.viaProto; locked 84% of time Unsynchronized access at RegisterNodeManagerRequestPBImpl.java:84% of time Unsynchronized access at RegisterNodeManagerRequestPBImpl.java: [line 70] Subsystem Report/Notes Docker Image:yetus/hadoop:0ca8df7 JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12784704/yarn-4647.001.patch JIRA Issue YARN-4647 Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle uname Linux 01ba86c9cf5a 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 Build tool maven Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh git revision trunk / 662e17b Default Java 1.7.0_91 Multi-JDK versions /usr/lib/jvm/java-8-oracle:1.8.0_66 /usr/lib/jvm/java-7-openjdk-amd64:1.7.0_91 findbugs v3.0.0 checkstyle https://builds.apache.org/job/PreCommit-YARN-Build/10416/artifact/patchprocess/diff-checkstyle-hadoop-yarn-project_hadoop-yarn_hadoop-yarn-server_hadoop-yarn-server-common.txt findbugs https://builds.apache.org/job/PreCommit-YARN-Build/10416/artifact/patchprocess/new-findbugs-hadoop-yarn-project_hadoop-yarn_hadoop-yarn-server_hadoop-yarn-server-common.html JDK v1.7.0_91 Test Results https://builds.apache.org/job/PreCommit-YARN-Build/10416/testReport/ modules C: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common U: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common Max memory used 76MB Powered by Apache Yetus 0.2.0-SNAPSHOT http://yetus.apache.org Console output https://builds.apache.org/job/PreCommit-YARN-Build/10416/console This message was automatically generated.
          Hide
          kasha Karthik Kambatla added a comment -

          Forgot to kick-off Jenkins. Will go ahead and commit this based on Wangda's +1 if Jenkins is fine with it.

          Show
          kasha Karthik Kambatla added a comment - Forgot to kick-off Jenkins. Will go ahead and commit this based on Wangda's +1 if Jenkins is fine with it.
          Hide
          kasha Karthik Kambatla added a comment -

          One case could be when getProto (calls mergeLocalToBuilder -> addRunningApplicationsToProto) is called concurrently with setRunningApplications.

          Show
          kasha Karthik Kambatla added a comment - One case could be when getProto (calls mergeLocalToBuilder -> addRunningApplicationsToProto) is called concurrently with setRunningApplications.
          Hide
          leftnoteasy Wangda Tan added a comment -

          Karthik Kambatla,
          +1 to the patch, just curious when race condition could happen.

          Show
          leftnoteasy Wangda Tan added a comment - Karthik Kambatla , +1 to the patch, just curious when race condition could happen.
          Hide
          kasha Karthik Kambatla added a comment -

          Trivial patch that adds synchronization similar to NodeStatusPBImpl and does a little more cleanup while at it.

          Show
          kasha Karthik Kambatla added a comment - Trivial patch that adds synchronization similar to NodeStatusPBImpl and does a little more cleanup while at it.

            People

            • Assignee:
              kasha Karthik Kambatla
              Reporter:
              kasha Karthik Kambatla
            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development