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

DrainDispatcher does not drain all events on stop even if setDrainEventsOnStop is true

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.9.0, 3.0.0-alpha2
    • Component/s: None
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      DrainDispatcher#serviceStop sets the stopped flag first before draining the event queue.
      This means that the thread terminates as soon as it encounters stopped flag as true and does not continue to process leftover events in queue, something which it should do if setDrainEventsOnStop is set.

      1. YARN-5911.01.patch
        4 kB
        Varun Saxena
      2. YARN-5911.02.patch
        5 kB
        Varun Saxena

        Activity

        Hide
        varun_saxena Varun Saxena added a comment -

        Added the test case in TestAsyncDispatcher itself instead of adding a new test class.

        Show
        varun_saxena Varun Saxena added a comment - Added the test case in TestAsyncDispatcher itself instead of adding a new test class.
        Hide
        hadoopqa Hadoop QA added a comment -
        +1 overall



        Vote Subsystem Runtime Comment
        0 reexec 0m 14s Docker mode activated.
        +1 @author 0m 0s The patch does not contain any @author tags.
        +1 test4tests 0m 0s The patch appears to include 2 new or modified test files.
        +1 mvninstall 7m 44s trunk passed
        +1 compile 0m 28s trunk passed
        +1 checkstyle 0m 20s trunk passed
        +1 mvnsite 0m 31s trunk passed
        +1 mvneclipse 0m 13s trunk passed
        +1 findbugs 1m 0s trunk passed
        +1 javadoc 0m 28s trunk passed
        +1 mvninstall 0m 26s the patch passed
        +1 compile 0m 24s the patch passed
        +1 javac 0m 24s the patch passed
        +1 checkstyle 0m 16s the patch passed
        +1 mvnsite 0m 29s the patch passed
        +1 mvneclipse 0m 11s the patch passed
        +1 whitespace 0m 0s The patch has no whitespace issues.
        +1 findbugs 1m 6s the patch passed
        +1 javadoc 0m 27s the patch passed
        +1 unit 2m 26s hadoop-yarn-common in the patch passed.
        +1 asflicense 0m 15s The patch does not generate ASF License warnings.
        18m 18s



        Subsystem Report/Notes
        Docker Image:yetus/hadoop:a9ad5d6
        JIRA Issue YARN-5911
        JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12839509/YARN-5911.01.patch
        Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle
        uname Linux df8c3dfab8f6 3.13.0-92-generic #139-Ubuntu SMP Tue Jun 28 20:42:26 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
        Build tool maven
        Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh
        git revision trunk / c0b1a44
        Default Java 1.8.0_111
        findbugs v3.0.0
        Test Results https://builds.apache.org/job/PreCommit-YARN-Build/13970/testReport/
        modules C: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common U: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common
        Console output https://builds.apache.org/job/PreCommit-YARN-Build/13970/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 14s Docker mode activated. +1 @author 0m 0s The patch does not contain any @author tags. +1 test4tests 0m 0s The patch appears to include 2 new or modified test files. +1 mvninstall 7m 44s trunk passed +1 compile 0m 28s trunk passed +1 checkstyle 0m 20s trunk passed +1 mvnsite 0m 31s trunk passed +1 mvneclipse 0m 13s trunk passed +1 findbugs 1m 0s trunk passed +1 javadoc 0m 28s trunk passed +1 mvninstall 0m 26s the patch passed +1 compile 0m 24s the patch passed +1 javac 0m 24s the patch passed +1 checkstyle 0m 16s the patch passed +1 mvnsite 0m 29s the patch passed +1 mvneclipse 0m 11s the patch passed +1 whitespace 0m 0s The patch has no whitespace issues. +1 findbugs 1m 6s the patch passed +1 javadoc 0m 27s the patch passed +1 unit 2m 26s hadoop-yarn-common in the patch passed. +1 asflicense 0m 15s The patch does not generate ASF License warnings. 18m 18s Subsystem Report/Notes Docker Image:yetus/hadoop:a9ad5d6 JIRA Issue YARN-5911 JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12839509/YARN-5911.01.patch Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle uname Linux df8c3dfab8f6 3.13.0-92-generic #139-Ubuntu SMP Tue Jun 28 20:42:26 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux Build tool maven Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh git revision trunk / c0b1a44 Default Java 1.8.0_111 findbugs v3.0.0 Test Results https://builds.apache.org/job/PreCommit-YARN-Build/13970/testReport/ modules C: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common U: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common Console output https://builds.apache.org/job/PreCommit-YARN-Build/13970/console Powered by Apache Yetus 0.4.0-SNAPSHOT http://yetus.apache.org This message was automatically generated.
        Hide
        bibinchundatt Bibin A Chundatt added a comment -

        Thank you Varun Saxena for jira.
        Overall patch looks good to me. Minor comment.

        1. Rename the test to testDrainDispatcherDrainEventsOnStop to make testcase more clear.
        Show
        bibinchundatt Bibin A Chundatt added a comment - Thank you Varun Saxena for jira. Overall patch looks good to me. Minor comment. Rename the test to testDrainDispatcherDrainEventsOnStop to make testcase more clear.
        Hide
        sandflee sandflee added a comment -

        thanks Varun Saxena, one minor comment:
        if events not drained, we should at least wait 1s since drainDispatcher not invoke waitForDrained.notify, could we use a shorter time?

                while (!isDrained() && eventHandlingThread != null
                    && eventHandlingThread.isAlive()
                    && System.currentTimeMillis() < endTime) {
                  waitForDrained.wait(1000);
                  LOG.info("Waiting for AsyncDispatcher to drain. Thread state is :" +
                      eventHandlingThread.getState());
                }
              }
        
        Show
        sandflee sandflee added a comment - thanks Varun Saxena , one minor comment: if events not drained, we should at least wait 1s since drainDispatcher not invoke waitForDrained.notify, could we use a shorter time? while (!isDrained() && eventHandlingThread != null && eventHandlingThread.isAlive() && System .currentTimeMillis() < endTime) { waitForDrained.wait(1000); LOG.info( "Waiting for AsyncDispatcher to drain. Thread state is :" + eventHandlingThread.getState()); } }
        Hide
        varun_saxena Varun Saxena added a comment -

        Thanks sandflee and Bibin for review.
        You are correct. We can probably use notify in DrainDispatcher as well but a timeout of 100 ms. should just do as well for tests. Reduced timeout to 100 ms. during wait.
        Also changed the name of test method.

        Show
        varun_saxena Varun Saxena added a comment - Thanks sandflee and Bibin for review. You are correct. We can probably use notify in DrainDispatcher as well but a timeout of 100 ms. should just do as well for tests. Reduced timeout to 100 ms. during wait. Also changed the name of test method.
        Hide
        hadoopqa Hadoop QA added a comment -
        +1 overall



        Vote Subsystem Runtime Comment
        0 reexec 0m 22s Docker mode activated.
        +1 @author 0m 0s The patch does not contain any @author tags.
        +1 test4tests 0m 0s The patch appears to include 2 new or modified test files.
        +1 mvninstall 8m 30s trunk passed
        +1 compile 0m 33s trunk passed
        +1 checkstyle 0m 22s trunk passed
        +1 mvnsite 0m 35s trunk passed
        +1 mvneclipse 0m 15s trunk passed
        +1 findbugs 1m 5s trunk passed
        +1 javadoc 0m 34s trunk passed
        +1 mvninstall 0m 30s the patch passed
        +1 compile 0m 27s the patch passed
        +1 javac 0m 27s the patch passed
        +1 checkstyle 0m 18s the patch passed
        +1 mvnsite 0m 33s the patch passed
        +1 mvneclipse 0m 13s the patch passed
        +1 whitespace 0m 0s The patch has no whitespace issues.
        +1 findbugs 1m 15s the patch passed
        +1 javadoc 0m 29s the patch passed
        +1 unit 2m 28s hadoop-yarn-common in the patch passed.
        +1 asflicense 0m 19s The patch does not generate ASF License warnings.
        20m 12s



        Subsystem Report/Notes
        Docker Image:yetus/hadoop:a9ad5d6
        JIRA Issue YARN-5911
        JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12839764/YARN-5911.02.patch
        Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle
        uname Linux 1c1cb638d62e 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 / c68dad1
        Default Java 1.8.0_111
        findbugs v3.0.0
        Test Results https://builds.apache.org/job/PreCommit-YARN-Build/13991/testReport/
        modules C: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common U: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common
        Console output https://builds.apache.org/job/PreCommit-YARN-Build/13991/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 22s Docker mode activated. +1 @author 0m 0s The patch does not contain any @author tags. +1 test4tests 0m 0s The patch appears to include 2 new or modified test files. +1 mvninstall 8m 30s trunk passed +1 compile 0m 33s trunk passed +1 checkstyle 0m 22s trunk passed +1 mvnsite 0m 35s trunk passed +1 mvneclipse 0m 15s trunk passed +1 findbugs 1m 5s trunk passed +1 javadoc 0m 34s trunk passed +1 mvninstall 0m 30s the patch passed +1 compile 0m 27s the patch passed +1 javac 0m 27s the patch passed +1 checkstyle 0m 18s the patch passed +1 mvnsite 0m 33s the patch passed +1 mvneclipse 0m 13s the patch passed +1 whitespace 0m 0s The patch has no whitespace issues. +1 findbugs 1m 15s the patch passed +1 javadoc 0m 29s the patch passed +1 unit 2m 28s hadoop-yarn-common in the patch passed. +1 asflicense 0m 19s The patch does not generate ASF License warnings. 20m 12s Subsystem Report/Notes Docker Image:yetus/hadoop:a9ad5d6 JIRA Issue YARN-5911 JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12839764/YARN-5911.02.patch Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle uname Linux 1c1cb638d62e 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 / c68dad1 Default Java 1.8.0_111 findbugs v3.0.0 Test Results https://builds.apache.org/job/PreCommit-YARN-Build/13991/testReport/ modules C: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common U: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common Console output https://builds.apache.org/job/PreCommit-YARN-Build/13991/console Powered by Apache Yetus 0.4.0-SNAPSHOT http://yetus.apache.org This message was automatically generated.
        Hide
        sandflee sandflee added a comment -

        seems no need to keep var stopped in DrainDispatcher?

        Show
        sandflee sandflee added a comment - seems no need to keep var stopped in DrainDispatcher?
        Hide
        varun_saxena Varun Saxena added a comment -

        seems no need to keep var stopped in DrainDispatcher?

        sandflee, it has been removed in the patch. You mean why it has been removed ?

        Show
        varun_saxena Varun Saxena added a comment - seems no need to keep var stopped in DrainDispatcher? sandflee , it has been removed in the patch. You mean why it has been removed ?
        Hide
        sandflee sandflee added a comment -

        sorry, not noticed it was removed in the patch,
        patch LGTM

        Show
        sandflee sandflee added a comment - sorry, not noticed it was removed in the patch, patch LGTM
        Hide
        Naganarasimha Naganarasimha G R added a comment -

        Thanks Varun Saxena,
        Patch looks fine and will commit it shortly !

        Show
        Naganarasimha Naganarasimha G R added a comment - Thanks Varun Saxena , Patch looks fine and will commit it shortly !
        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Jenkins build Hadoop-trunk-Commit #10878 (See https://builds.apache.org/job/Hadoop-trunk-Commit/10878/)
        YARN-5911. DrainDispatcher does not drain all events on stop even if (naganarasimha_gr: rev 466756416214a4bbc77af8a29da1a33e01106864)

        • (edit) hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/event/TestAsyncDispatcher.java
        • (edit) hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/event/AsyncDispatcher.java
        • (edit) hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/event/DrainDispatcher.java
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Jenkins build Hadoop-trunk-Commit #10878 (See https://builds.apache.org/job/Hadoop-trunk-Commit/10878/ ) YARN-5911 . DrainDispatcher does not drain all events on stop even if (naganarasimha_gr: rev 466756416214a4bbc77af8a29da1a33e01106864) (edit) hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/event/TestAsyncDispatcher.java (edit) hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/event/AsyncDispatcher.java (edit) hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/event/DrainDispatcher.java
        Hide
        Naganarasimha Naganarasimha G R added a comment -

        Thanks for the contribution Varun Saxena and review from Bibin A Chundatt and sandflee. Committed it trunk and branch-2.

        Show
        Naganarasimha Naganarasimha G R added a comment - Thanks for the contribution Varun Saxena and review from Bibin A Chundatt and sandflee . Committed it trunk and branch-2.
        Hide
        varun_saxena Varun Saxena added a comment -

        Thanks Naganarasimha G R for the review and commit and thanks sandflee and Bibin A Chundatt for reviews.

        Show
        varun_saxena Varun Saxena added a comment - Thanks Naganarasimha G R for the review and commit and thanks sandflee and Bibin A Chundatt for reviews.

          People

          • Assignee:
            varun_saxena Varun Saxena
            Reporter:
            varun_saxena Varun Saxena
          • Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development