Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-12423

Handle failure of registering shutdownhook by ShutdownHookManager in static block

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.7.1
    • Fix Version/s: 2.8.0, 3.0.0-alpha1
    • Component/s: fs
    • Labels:
      None
    • Target Version/s:
    • Hadoop Flags:
      Reviewed

      Description

      If JVM is under shutdown, static method in ShutdownHookManager will throw an IllegalStateException. This exception should be caught and ignored while registering the hooks.

      Stack trace:

      java.lang.NoClassDefFoundError: Could not initialize class org.apache.hadoop.util.ShutdownHookManager
             at org.apache.hadoop.fs.FileSystem$Cache.getInternal(FileSystem.java:2639) ~[stormjar.jar:1.4.0-SNAPSHOT]
             at org.apache.hadoop.fs.FileSystem$Cache.get(FileSystem.java:2612) ~[stormjar.jar:1.4.0-SNAPSHOT]
             at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:370) ~[stormjar.jar:1.4.0-SNAPSHOT]
             ...
             ...
             at backtype.storm.daemon.executor$fn__6647$fn__6659.invoke(executor.clj:692) ~[storm-core-0.9.5.jar:0.9.5]
             at backtype.storm.util$async_loop$fn__459.invoke(util.clj:461) ~[storm-core-0.9.5.jar:0.9.5]
             at clojure.lang.AFn.run(AFn.java:24) [clojure-1.5.1.jar:na]
             at java.lang.Thread.run(Thread.java:745) [na:1.8.0_60]
      
      1. HADOOP-12423.patch
        2 kB
        Abhishek Agarwal

        Activity

        Hide
        lakshman Laxman added a comment -

        Abhishek Agarwal, that is expected behavior. client should not be able to register a hook when shutdown is already in progress and client should be handling this exception. we should not be suppressing the exception in ShutdownHookManager.

        Show
        lakshman Laxman added a comment - Abhishek Agarwal , that is expected behavior. client should not be able to register a hook when shutdown is already in progress and client should be handling this exception. we should not be suppressing the exception in ShutdownHookManager.
        Hide
        lakshman Laxman added a comment -

        Abhishek Agarwal, sorry. I misread it. After going through patch, I understood the issue you are referring to.
        In the scenario you mentioned, throwing an exception in static block may lead to Class initialization exception and errors may be misleading.

        +1 patch looks good to me (non-binding).

        Show
        lakshman Laxman added a comment - Abhishek Agarwal , sorry. I misread it. After going through patch, I understood the issue you are referring to. In the scenario you mentioned, throwing an exception in static block may lead to Class initialization exception and errors may be misleading. +1 patch looks good to me (non-binding).
        Hide
        hadoopqa Hadoop QA added a comment -



        -1 overall



        Vote Subsystem Runtime Comment
        0 pre-patch 17m 11s Pre-patch trunk compilation is healthy.
        +1 @author 0m 0s The patch does not contain any @author tags.
        -1 tests included 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 javac 7m 46s There were no new javac warning messages.
        +1 javadoc 10m 7s There were no new javadoc warning messages.
        +1 release audit 0m 24s The applied patch does not increase the total number of release audit warnings.
        -1 checkstyle 1m 5s The applied patch generated 1 new checkstyle issues (total was 7, now 7).
        +1 whitespace 0m 0s The patch has no lines that end in whitespace.
        +1 install 1m 29s mvn install still works.
        +1 eclipse:eclipse 0m 34s The patch built with eclipse:eclipse.
        +1 findbugs 1m 58s The patch does not introduce any new Findbugs (version 3.0.0) warnings.
        -1 common tests 22m 45s Tests failed in hadoop-common.
            63m 22s  



        Reason Tests
        Failed unit tests hadoop.ipc.TestRPC



        Subsystem Report/Notes
        Patch URL http://issues.apache.org/jira/secure/attachment/12758382/HADOOP-12423.patch
        Optional Tests javadoc javac unit findbugs checkstyle
        git revision trunk / 92c1af1
        checkstyle https://builds.apache.org/job/PreCommit-HADOOP-Build/7674/artifact/patchprocess/diffcheckstylehadoop-common.txt
        hadoop-common test log https://builds.apache.org/job/PreCommit-HADOOP-Build/7674/artifact/patchprocess/testrun_hadoop-common.txt
        Test Results https://builds.apache.org/job/PreCommit-HADOOP-Build/7674/testReport/
        Java 1.7.0_55
        uname Linux asf901.gq1.ygridcore.net 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
        Console output https://builds.apache.org/job/PreCommit-HADOOP-Build/7674/console

        This message was automatically generated.

        Show
        hadoopqa Hadoop QA added a comment - -1 overall Vote Subsystem Runtime Comment 0 pre-patch 17m 11s Pre-patch trunk compilation is healthy. +1 @author 0m 0s The patch does not contain any @author tags. -1 tests included 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 javac 7m 46s There were no new javac warning messages. +1 javadoc 10m 7s There were no new javadoc warning messages. +1 release audit 0m 24s The applied patch does not increase the total number of release audit warnings. -1 checkstyle 1m 5s The applied patch generated 1 new checkstyle issues (total was 7, now 7). +1 whitespace 0m 0s The patch has no lines that end in whitespace. +1 install 1m 29s mvn install still works. +1 eclipse:eclipse 0m 34s The patch built with eclipse:eclipse. +1 findbugs 1m 58s The patch does not introduce any new Findbugs (version 3.0.0) warnings. -1 common tests 22m 45s Tests failed in hadoop-common.     63m 22s   Reason Tests Failed unit tests hadoop.ipc.TestRPC Subsystem Report/Notes Patch URL http://issues.apache.org/jira/secure/attachment/12758382/HADOOP-12423.patch Optional Tests javadoc javac unit findbugs checkstyle git revision trunk / 92c1af1 checkstyle https://builds.apache.org/job/PreCommit-HADOOP-Build/7674/artifact/patchprocess/diffcheckstylehadoop-common.txt hadoop-common test log https://builds.apache.org/job/PreCommit-HADOOP-Build/7674/artifact/patchprocess/testrun_hadoop-common.txt Test Results https://builds.apache.org/job/PreCommit-HADOOP-Build/7674/testReport/ Java 1.7.0_55 uname Linux asf901.gq1.ygridcore.net 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 Console output https://builds.apache.org/job/PreCommit-HADOOP-Build/7674/console This message was automatically generated.
        Hide
        abhishek.agarwal Abhishek Agarwal added a comment -

        can someone review the patch and resolve it accordingly?

        Show
        abhishek.agarwal Abhishek Agarwal added a comment - can someone review the patch and resolve it accordingly?
        Hide
        vinayrpet Vinayakumar B added a comment -

        +1 for the patch.
        Will commit later tonight.

        Show
        vinayrpet Vinayakumar B added a comment - +1 for the patch. Will commit later tonight.
        Hide
        vinayrpet Vinayakumar B added a comment -

        Changed the title, to reduce confusion.

        Show
        vinayrpet Vinayakumar B added a comment - Changed the title, to reduce confusion.
        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 8m 35s trunk passed
        +1 compile 7m 6s trunk passed with JDK v1.8.0_66
        +1 compile 7m 50s trunk passed with JDK v1.7.0_91
        +1 checkstyle 0m 17s trunk passed
        +1 mvnsite 1m 9s trunk passed
        +1 mvneclipse 0m 14s trunk passed
        +1 findbugs 2m 0s trunk passed
        +1 javadoc 0m 59s trunk passed with JDK v1.8.0_66
        +1 javadoc 1m 10s trunk passed with JDK v1.7.0_91
        +1 mvninstall 1m 45s the patch passed
        +1 compile 7m 5s the patch passed with JDK v1.8.0_66
        +1 javac 7m 5s the patch passed
        +1 compile 6m 47s the patch passed with JDK v1.7.0_91
        +1 javac 6m 47s the patch passed
        -1 checkstyle 0m 14s hadoop-common-project/hadoop-common: patch generated 1 new + 6 unchanged - 1 fixed = 7 total (was 7)
        +1 mvnsite 0m 59s the patch passed
        +1 mvneclipse 0m 13s the patch passed
        +1 whitespace 0m 0s Patch has no whitespace issues.
        +1 findbugs 2m 0s the patch passed
        +1 javadoc 0m 52s the patch passed with JDK v1.8.0_66
        +1 javadoc 1m 1s the patch passed with JDK v1.7.0_91
        +1 unit 6m 20s hadoop-common in the patch passed with JDK v1.8.0_66.
        +1 unit 6m 37s hadoop-common in the patch passed with JDK v1.7.0_91.
        +1 asflicense 0m 22s Patch does not generate ASF License warnings.
        75m 21s



        Subsystem Report/Notes
        Docker Image:yetus/hadoop:0ca8df7
        JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12758382/HADOOP-12423.patch
        JIRA Issue HADOOP-12423
        Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle
        uname Linux 5d89d4684f9c 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 / 57d0a94
        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-HADOOP-Build/8441/artifact/patchprocess/diff-checkstyle-hadoop-common-project_hadoop-common.txt
        JDK v1.7.0_91 Test Results https://builds.apache.org/job/PreCommit-HADOOP-Build/8441/testReport/
        modules C: hadoop-common-project/hadoop-common U: hadoop-common-project/hadoop-common
        Max memory used 77MB
        Powered by Apache Yetus 0.2.0-SNAPSHOT http://yetus.apache.org
        Console output https://builds.apache.org/job/PreCommit-HADOOP-Build/8441/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 8m 35s trunk passed +1 compile 7m 6s trunk passed with JDK v1.8.0_66 +1 compile 7m 50s trunk passed with JDK v1.7.0_91 +1 checkstyle 0m 17s trunk passed +1 mvnsite 1m 9s trunk passed +1 mvneclipse 0m 14s trunk passed +1 findbugs 2m 0s trunk passed +1 javadoc 0m 59s trunk passed with JDK v1.8.0_66 +1 javadoc 1m 10s trunk passed with JDK v1.7.0_91 +1 mvninstall 1m 45s the patch passed +1 compile 7m 5s the patch passed with JDK v1.8.0_66 +1 javac 7m 5s the patch passed +1 compile 6m 47s the patch passed with JDK v1.7.0_91 +1 javac 6m 47s the patch passed -1 checkstyle 0m 14s hadoop-common-project/hadoop-common: patch generated 1 new + 6 unchanged - 1 fixed = 7 total (was 7) +1 mvnsite 0m 59s the patch passed +1 mvneclipse 0m 13s the patch passed +1 whitespace 0m 0s Patch has no whitespace issues. +1 findbugs 2m 0s the patch passed +1 javadoc 0m 52s the patch passed with JDK v1.8.0_66 +1 javadoc 1m 1s the patch passed with JDK v1.7.0_91 +1 unit 6m 20s hadoop-common in the patch passed with JDK v1.8.0_66. +1 unit 6m 37s hadoop-common in the patch passed with JDK v1.7.0_91. +1 asflicense 0m 22s Patch does not generate ASF License warnings. 75m 21s Subsystem Report/Notes Docker Image:yetus/hadoop:0ca8df7 JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12758382/HADOOP-12423.patch JIRA Issue HADOOP-12423 Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle uname Linux 5d89d4684f9c 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 / 57d0a94 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-HADOOP-Build/8441/artifact/patchprocess/diff-checkstyle-hadoop-common-project_hadoop-common.txt JDK v1.7.0_91 Test Results https://builds.apache.org/job/PreCommit-HADOOP-Build/8441/testReport/ modules C: hadoop-common-project/hadoop-common U: hadoop-common-project/hadoop-common Max memory used 77MB Powered by Apache Yetus 0.2.0-SNAPSHOT http://yetus.apache.org Console output https://builds.apache.org/job/PreCommit-HADOOP-Build/8441/console This message was automatically generated.
        Hide
        vinayrpet Vinayakumar B added a comment -

        Committed to trunk, branch-2 and branch-2.8
        thanks for the contribution Abhishek Agarwal
        thanks Laxman for review.

        Show
        vinayrpet Vinayakumar B added a comment - Committed to trunk, branch-2 and branch-2.8 thanks for the contribution Abhishek Agarwal thanks Laxman for review.
        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Hadoop-trunk-Commit #9148 (See https://builds.apache.org/job/Hadoop-trunk-Commit/9148/)
        HADOOP-12423. Handle failure of registering shutdownhook by (vinayakumarb: rev 446987e20aacd870e1bc3f950b2bd4bbda1f9571)

        • hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/ShutdownHookManager.java
        • hadoop-common-project/hadoop-common/CHANGES.txt
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Hadoop-trunk-Commit #9148 (See https://builds.apache.org/job/Hadoop-trunk-Commit/9148/ ) HADOOP-12423 . Handle failure of registering shutdownhook by (vinayakumarb: rev 446987e20aacd870e1bc3f950b2bd4bbda1f9571) hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/ShutdownHookManager.java hadoop-common-project/hadoop-common/CHANGES.txt

          People

          • Assignee:
            abhishek.agarwal Abhishek Agarwal
            Reporter:
            abhishek.agarwal Abhishek Agarwal
          • Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development