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

Fix race condition in TestGetGroups beforeclass setup()

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.0.0-alpha1
    • Fix Version/s: 2.9.0, 3.0.0-alpha2
    • Component/s: yarn
    • Labels:

      Description

      In TestGetGroups, the class-level setup method spins up, in a child thread, a resource manager that Yarn clients can talk to. But it checks whether the resource manager is fully started by doing resourcemanager.getServiceState() == STATE.STARTED. This is not reliable since resourcemanager.start() will first trigger service state change in RM, and then starts up all the services added to RM. We need to wait for RM to fully start before YARN clients can send requests. Otherwise, the tests can fail due to "connection refused" exception when the main thread sends out client requests to RM and if the RPC server has not fired up in the child thread.

      1. yarn5901.001.patch
        3 kB
        Haibo Chen
      2. YARN-5901.02.patch
        3 kB
        Haibo Chen
      3. YARN-5901.03.patch
        3 kB
        Haibo Chen
      4. YARN-5901-branch-2.03.patch
        3 kB
        Haibo Chen

        Activity

        Hide
        hadoopqa Hadoop QA added a comment -
        +1 overall



        Vote Subsystem Runtime Comment
        0 reexec 0m 13s Docker mode activated.
        +1 @author 0m 0s The patch does not contain any @author tags.
        +1 test4tests 0m 0s The patch appears to include 1 new or modified test files.
        +1 mvninstall 7m 14s trunk passed
        +1 compile 0m 20s trunk passed
        +1 checkstyle 0m 14s trunk passed
        +1 mvnsite 0m 25s trunk passed
        +1 mvneclipse 0m 16s trunk passed
        +1 findbugs 0m 30s trunk passed
        +1 javadoc 0m 15s trunk passed
        +1 mvninstall 0m 20s the patch passed
        +1 compile 0m 18s the patch passed
        +1 javac 0m 18s the patch passed
        +1 checkstyle 0m 12s hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client: The patch generated 0 new + 1 unchanged - 1 fixed = 1 total (was 2)
        +1 mvnsite 0m 22s the patch passed
        +1 mvneclipse 0m 13s the patch passed
        +1 whitespace 0m 0s The patch has no whitespace issues.
        +1 findbugs 0m 36s the patch passed
        +1 javadoc 0m 12s the patch passed
        +1 unit 16m 23s hadoop-yarn-client in the patch passed.
        +1 asflicense 0m 17s The patch does not generate ASF License warnings.
        29m 37s



        Subsystem Report/Notes
        Docker Image:yetus/hadoop:a9ad5d6
        JIRA Issue YARN-5901
        JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12839420/yarn5901.001.patch
        Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle
        uname Linux e30ebba5489c 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 / bd37355
        Default Java 1.8.0_111
        findbugs v3.0.0
        Test Results https://builds.apache.org/job/PreCommit-YARN-Build/13958/testReport/
        modules C: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client U: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client
        Console output https://builds.apache.org/job/PreCommit-YARN-Build/13958/console
        Powered by Apache Yetus 0.4.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 13s Docker mode activated. +1 @author 0m 0s The patch does not contain any @author tags. +1 test4tests 0m 0s The patch appears to include 1 new or modified test files. +1 mvninstall 7m 14s trunk passed +1 compile 0m 20s trunk passed +1 checkstyle 0m 14s trunk passed +1 mvnsite 0m 25s trunk passed +1 mvneclipse 0m 16s trunk passed +1 findbugs 0m 30s trunk passed +1 javadoc 0m 15s trunk passed +1 mvninstall 0m 20s the patch passed +1 compile 0m 18s the patch passed +1 javac 0m 18s the patch passed +1 checkstyle 0m 12s hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client: The patch generated 0 new + 1 unchanged - 1 fixed = 1 total (was 2) +1 mvnsite 0m 22s the patch passed +1 mvneclipse 0m 13s the patch passed +1 whitespace 0m 0s The patch has no whitespace issues. +1 findbugs 0m 36s the patch passed +1 javadoc 0m 12s the patch passed +1 unit 16m 23s hadoop-yarn-client in the patch passed. +1 asflicense 0m 17s The patch does not generate ASF License warnings. 29m 37s Subsystem Report/Notes Docker Image:yetus/hadoop:a9ad5d6 JIRA Issue YARN-5901 JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12839420/yarn5901.001.patch Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle uname Linux e30ebba5489c 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 / bd37355 Default Java 1.8.0_111 findbugs v3.0.0 Test Results https://builds.apache.org/job/PreCommit-YARN-Build/13958/testReport/ modules C: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client U: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client Console output https://builds.apache.org/job/PreCommit-YARN-Build/13958/console Powered by Apache Yetus 0.4.0-SNAPSHOT http://yetus.apache.org This message was automatically generated.
        Hide
        yufeigu Yufei Gu added a comment -

        Thanks Haibo Chen for the patch. The patch looks great.
        One nit: can we provide meaningful error messages if RM doesn't start in 60s?

        Show
        yufeigu Yufei Gu added a comment - Thanks Haibo Chen for the patch. The patch looks great. One nit: can we provide meaningful error messages if RM doesn't start in 60s?
        Hide
        templedf Daniel Templeton added a comment -

        Ditto on the error message. You can assert that the await() is true. In fact, without the assert, you'll continue on even if the RM doesn't start.

        Otherwise, looks great. Nice use of a CountDownLatch.

        Show
        templedf Daniel Templeton added a comment - Ditto on the error message. You can assert that the await() is true. In fact, without the assert, you'll continue on even if the RM doesn't start. Otherwise, looks great. Nice use of a CountDownLatch .
        Hide
        haibochen Haibo Chen added a comment -

        Thanks Daniel Templeton for your review! Will update the patch shortly.

        Show
        haibochen Haibo Chen added a comment - Thanks Daniel Templeton for your review! Will update the patch shortly.
        Hide
        hadoopqa Hadoop QA added a comment -
        +1 overall



        Vote Subsystem Runtime Comment
        0 reexec 0m 53s Docker mode activated.
        +1 @author 0m 0s The patch does not contain any @author tags.
        +1 test4tests 0m 0s The patch appears to include 1 new or modified test files.
        +1 mvninstall 8m 19s trunk passed
        +1 compile 0m 21s trunk passed
        +1 checkstyle 0m 15s trunk passed
        +1 mvnsite 0m 27s trunk passed
        +1 mvneclipse 0m 16s trunk passed
        +1 findbugs 0m 31s trunk passed
        +1 javadoc 0m 16s trunk passed
        +1 mvninstall 0m 20s the patch passed
        +1 compile 0m 19s the patch passed
        +1 javac 0m 19s the patch passed
        +1 checkstyle 0m 12s hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client: The patch generated 0 new + 1 unchanged - 1 fixed = 1 total (was 2)
        +1 mvnsite 0m 23s the patch passed
        +1 mvneclipse 0m 13s the patch passed
        +1 whitespace 0m 1s The patch has no whitespace issues.
        +1 findbugs 0m 35s the patch passed
        +1 javadoc 0m 12s the patch passed
        +1 unit 16m 15s hadoop-yarn-client in the patch passed.
        +1 asflicense 0m 16s The patch does not generate ASF License warnings.
        31m 21s



        Subsystem Report/Notes
        Docker Image:yetus/hadoop:a9ad5d6
        JIRA Issue YARN-5901
        JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12840333/YARN-5901.02.patch
        Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle
        uname Linux ff9445c028f3 3.13.0-95-generic #142-Ubuntu SMP Fri Aug 12 17:00:09 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
        Build tool maven
        Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh
        git revision trunk / 0de0c32
        Default Java 1.8.0_111
        findbugs v3.0.0
        Test Results https://builds.apache.org/job/PreCommit-YARN-Build/14066/testReport/
        modules C: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client U: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client
        Console output https://builds.apache.org/job/PreCommit-YARN-Build/14066/console
        Powered by Apache Yetus 0.4.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 53s Docker mode activated. +1 @author 0m 0s The patch does not contain any @author tags. +1 test4tests 0m 0s The patch appears to include 1 new or modified test files. +1 mvninstall 8m 19s trunk passed +1 compile 0m 21s trunk passed +1 checkstyle 0m 15s trunk passed +1 mvnsite 0m 27s trunk passed +1 mvneclipse 0m 16s trunk passed +1 findbugs 0m 31s trunk passed +1 javadoc 0m 16s trunk passed +1 mvninstall 0m 20s the patch passed +1 compile 0m 19s the patch passed +1 javac 0m 19s the patch passed +1 checkstyle 0m 12s hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client: The patch generated 0 new + 1 unchanged - 1 fixed = 1 total (was 2) +1 mvnsite 0m 23s the patch passed +1 mvneclipse 0m 13s the patch passed +1 whitespace 0m 1s The patch has no whitespace issues. +1 findbugs 0m 35s the patch passed +1 javadoc 0m 12s the patch passed +1 unit 16m 15s hadoop-yarn-client in the patch passed. +1 asflicense 0m 16s The patch does not generate ASF License warnings. 31m 21s Subsystem Report/Notes Docker Image:yetus/hadoop:a9ad5d6 JIRA Issue YARN-5901 JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12840333/YARN-5901.02.patch Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle uname Linux ff9445c028f3 3.13.0-95-generic #142-Ubuntu SMP Fri Aug 12 17:00:09 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux Build tool maven Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh git revision trunk / 0de0c32 Default Java 1.8.0_111 findbugs v3.0.0 Test Results https://builds.apache.org/job/PreCommit-YARN-Build/14066/testReport/ modules C: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client U: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client Console output https://builds.apache.org/job/PreCommit-YARN-Build/14066/console Powered by Apache Yetus 0.4.0-SNAPSHOT http://yetus.apache.org This message was automatically generated.
        Hide
        templedf Daniel Templeton added a comment -

        Two tiny nits:

        1. In your service listener, you should probably call service.getServiceState() instead, and
        2. In the test, why is the rmStarted variable final?
        Show
        templedf Daniel Templeton added a comment - Two tiny nits: In your service listener, you should probably call service.getServiceState() instead, and In the test, why is the rmStarted variable final?
        Hide
        haibochen Haibo Chen added a comment -

        Will update the patch shortly.

        Show
        haibochen Haibo Chen added a comment - Will update the patch shortly.
        Hide
        hadoopqa Hadoop QA added a comment -
        +1 overall



        Vote Subsystem Runtime Comment
        0 reexec 0m 15s Docker mode activated.
        +1 @author 0m 0s The patch does not contain any @author tags.
        +1 test4tests 0m 0s The patch appears to include 1 new or modified test files.
        +1 mvninstall 7m 5s trunk passed
        +1 compile 0m 21s trunk passed
        +1 checkstyle 0m 14s trunk passed
        +1 mvnsite 0m 27s trunk passed
        +1 mvneclipse 0m 16s trunk passed
        +1 findbugs 0m 29s trunk passed
        +1 javadoc 0m 16s trunk passed
        +1 mvninstall 0m 19s the patch passed
        +1 compile 0m 18s the patch passed
        +1 javac 0m 18s the patch passed
        +1 checkstyle 0m 13s hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client: The patch generated 0 new + 1 unchanged - 1 fixed = 1 total (was 2)
        +1 mvnsite 0m 23s the patch passed
        +1 mvneclipse 0m 13s the patch passed
        +1 whitespace 0m 0s The patch has no whitespace issues.
        +1 findbugs 0m 34s the patch passed
        +1 javadoc 0m 13s the patch passed
        +1 unit 16m 14s hadoop-yarn-client in the patch passed.
        +1 asflicense 0m 15s The patch does not generate ASF License warnings.
        29m 25s



        Subsystem Report/Notes
        Docker Image:yetus/hadoop:a9ad5d6
        JIRA Issue YARN-5901
        JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12841357/YARN-5901.03.patch
        Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle
        uname Linux d43aba5c0599 3.13.0-95-generic #142-Ubuntu SMP Fri Aug 12 17:00:09 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
        Build tool maven
        Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh
        git revision trunk / 19f373a
        Default Java 1.8.0_111
        findbugs v3.0.0
        Test Results https://builds.apache.org/job/PreCommit-YARN-Build/14148/testReport/
        modules C: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client U: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client
        Console output https://builds.apache.org/job/PreCommit-YARN-Build/14148/console
        Powered by Apache Yetus 0.4.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 15s Docker mode activated. +1 @author 0m 0s The patch does not contain any @author tags. +1 test4tests 0m 0s The patch appears to include 1 new or modified test files. +1 mvninstall 7m 5s trunk passed +1 compile 0m 21s trunk passed +1 checkstyle 0m 14s trunk passed +1 mvnsite 0m 27s trunk passed +1 mvneclipse 0m 16s trunk passed +1 findbugs 0m 29s trunk passed +1 javadoc 0m 16s trunk passed +1 mvninstall 0m 19s the patch passed +1 compile 0m 18s the patch passed +1 javac 0m 18s the patch passed +1 checkstyle 0m 13s hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client: The patch generated 0 new + 1 unchanged - 1 fixed = 1 total (was 2) +1 mvnsite 0m 23s the patch passed +1 mvneclipse 0m 13s the patch passed +1 whitespace 0m 0s The patch has no whitespace issues. +1 findbugs 0m 34s the patch passed +1 javadoc 0m 13s the patch passed +1 unit 16m 14s hadoop-yarn-client in the patch passed. +1 asflicense 0m 15s The patch does not generate ASF License warnings. 29m 25s Subsystem Report/Notes Docker Image:yetus/hadoop:a9ad5d6 JIRA Issue YARN-5901 JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12841357/YARN-5901.03.patch Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle uname Linux d43aba5c0599 3.13.0-95-generic #142-Ubuntu SMP Fri Aug 12 17:00:09 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux Build tool maven Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh git revision trunk / 19f373a Default Java 1.8.0_111 findbugs v3.0.0 Test Results https://builds.apache.org/job/PreCommit-YARN-Build/14148/testReport/ modules C: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client U: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client Console output https://builds.apache.org/job/PreCommit-YARN-Build/14148/console Powered by Apache Yetus 0.4.0-SNAPSHOT http://yetus.apache.org This message was automatically generated.
        Hide
        templedf Daniel Templeton added a comment -

        LGTM +1

        Show
        templedf Daniel Templeton added a comment - LGTM +1
        Hide
        haibochen Haibo Chen added a comment -

        Uploading a patch for branch-2.

        Show
        haibochen Haibo Chen added a comment - Uploading a patch for branch-2.
        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Jenkins build Hadoop-trunk-Commit #10926 (See https://builds.apache.org/job/Hadoop-trunk-Commit/10926/)
        YARN-5901. Fix race condition in TestGetGroups beforeclass setup() (templedf: rev 2d77dc727d9b5e56009bbc36643d85500efcbca5)

        • (edit) hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/TestGetGroups.java
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Jenkins build Hadoop-trunk-Commit #10926 (See https://builds.apache.org/job/Hadoop-trunk-Commit/10926/ ) YARN-5901 . Fix race condition in TestGetGroups beforeclass setup() (templedf: rev 2d77dc727d9b5e56009bbc36643d85500efcbca5) (edit) hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/TestGetGroups.java
        Hide
        templedf Daniel Templeton added a comment -

        Thanks for the patch, Haibo Chen! Committed to trunk and branch-2.

        Show
        templedf Daniel Templeton added a comment - Thanks for the patch, Haibo Chen ! Committed to trunk and branch-2.
        Hide
        djp Junping Du added a comment -

        This patch goes to branch-2 only instead of 2.8, set 2.9 as fix version.

        Show
        djp Junping Du added a comment - This patch goes to branch-2 only instead of 2.8, set 2.9 as fix version.

          People

          • Assignee:
            haibochen Haibo Chen
            Reporter:
            haibochen Haibo Chen
          • Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development