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

AsyncDispatcher possibly invokes multiple shutdown thread when handling exception

    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

      below code when handling exceptions: it is possible to launch multiple shutdown threads if there are events left in the queue that caused to throw exceptions.

          } catch (Throwable t) {
            //TODO Maybe log the state of the queue
            LOG.fatal("Error in dispatcher thread", t);
            // If serviceStop is called, we should exit this thread gracefully.
            if (exitOnDispatchException
                && (ShutdownHookManager.get().isShutdownInProgress()) == false
                && stopped == false) {
              Thread shutDownThread = new Thread(createShutDownThread());
              shutDownThread.setName("AsyncDispatcher ShutDown handler");
              shutDownThread.start();
            }
          }
      

        Activity

        Hide
        jianhe Jian He added a comment -

        Varun Saxena, thanks for the review and commit !

        Show
        jianhe Jian He added a comment - Varun Saxena , thanks for the review and commit !
        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Jenkins build Hadoop-trunk-Commit #10738 (See https://builds.apache.org/job/Hadoop-trunk-Commit/10738/)
        YARN-5809. AsyncDispatcher possibly invokes multiple shutdown threads (varunsaxena: rev 07ab89e8bb3f647cef4f80f39237169a0c6a8520)

        • (edit) hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/event/AsyncDispatcher.java
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Jenkins build Hadoop-trunk-Commit #10738 (See https://builds.apache.org/job/Hadoop-trunk-Commit/10738/ ) YARN-5809 . AsyncDispatcher possibly invokes multiple shutdown threads (varunsaxena: rev 07ab89e8bb3f647cef4f80f39237169a0c6a8520) (edit) hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/event/AsyncDispatcher.java
        Hide
        varun_saxena Varun Saxena added a comment -

        Committed to trunk, branch-2.
        Thanks Jian He for your contribution.

        Show
        varun_saxena Varun Saxena added a comment - Committed to trunk, branch-2. Thanks Jian He for your contribution.
        Hide
        varun_saxena Varun Saxena added a comment - - edited

        Thanks Jian He for the patch.
        IIUC, even if an unnecessary additional shutdown thread is created, that would be destroyed when JVM exits.
        But it makes sense to set the stopped flag and not let other events process when RM is shutting down and not starting extra shutdown threads.

        +1. Will commit it.

        Show
        varun_saxena Varun Saxena added a comment - - edited Thanks Jian He for the patch. IIUC, even if an unnecessary additional shutdown thread is created, that would be destroyed when JVM exits. But it makes sense to set the stopped flag and not let other events process when RM is shutting down and not starting extra shutdown threads. +1. Will commit it.
        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 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 8m 7s trunk passed
        +1 compile 0m 28s trunk passed
        +1 checkstyle 0m 19s trunk passed
        +1 mvnsite 0m 30s trunk passed
        +1 mvneclipse 0m 13s trunk passed
        +1 findbugs 0m 54s trunk passed
        +1 javadoc 0m 28s trunk passed
        +1 mvninstall 0m 27s the patch passed
        +1 compile 0m 30s the patch passed
        +1 javac 0m 30s the patch passed
        +1 checkstyle 0m 19s the patch passed
        +1 mvnsite 0m 29s the patch passed
        +1 mvneclipse 0m 9s the patch passed
        +1 whitespace 0m 1s The patch has no whitespace issues.
        +1 findbugs 0m 59s the patch passed
        +1 javadoc 0m 24s the patch passed
        +1 unit 2m 14s hadoop-yarn-common in the patch passed.
        +1 asflicense 0m 17s The patch does not generate ASF License warnings.
        18m 17s



        Subsystem Report/Notes
        Docker Image:yetus/hadoop:9560f25
        JIRA Issue YARN-5809
        JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12836231/YARN-5809.1.patch
        Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle
        uname Linux 98e1d88fa2bc 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 / a1761a8
        Default Java 1.8.0_101
        findbugs v3.0.0
        Test Results https://builds.apache.org/job/PreCommit-YARN-Build/13707/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/13707/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 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 8m 7s trunk passed +1 compile 0m 28s trunk passed +1 checkstyle 0m 19s trunk passed +1 mvnsite 0m 30s trunk passed +1 mvneclipse 0m 13s trunk passed +1 findbugs 0m 54s trunk passed +1 javadoc 0m 28s trunk passed +1 mvninstall 0m 27s the patch passed +1 compile 0m 30s the patch passed +1 javac 0m 30s the patch passed +1 checkstyle 0m 19s the patch passed +1 mvnsite 0m 29s the patch passed +1 mvneclipse 0m 9s the patch passed +1 whitespace 0m 1s The patch has no whitespace issues. +1 findbugs 0m 59s the patch passed +1 javadoc 0m 24s the patch passed +1 unit 2m 14s hadoop-yarn-common in the patch passed. +1 asflicense 0m 17s The patch does not generate ASF License warnings. 18m 17s Subsystem Report/Notes Docker Image:yetus/hadoop:9560f25 JIRA Issue YARN-5809 JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12836231/YARN-5809.1.patch Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle uname Linux 98e1d88fa2bc 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 / a1761a8 Default Java 1.8.0_101 findbugs v3.0.0 Test Results https://builds.apache.org/job/PreCommit-YARN-Build/13707/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/13707/console Powered by Apache Yetus 0.4.0-SNAPSHOT http://yetus.apache.org This message was automatically generated.

          People

          • Assignee:
            jianhe Jian He
            Reporter:
            jianhe Jian He
          • Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development