Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-8896

DataNode object isn't GCed when shutdown, because it has GC root in ShutdownHookManager

    Details

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

      Description

      The anonymous Thread object created in ShutdownHookManager is a GC root.
      screenshot_1 shows how DN object be traced to the GC root.

      It's not a problem in production.
      It's a problem in test, especially when MiniDFSCluster starts/shutdowns many DNs, which could cause OutOfMemoryError.
      screenshot_2 shows many DN objects are not GCed when run the test of HDFS-8838.

      1. screenshot_1.PNG
        38 kB
        Walter Su
      2. screenshot_2.PNG
        3 kB
        Walter Su
      3. HDFS-8896.01.patch
        2 kB
        Walter Su

        Issue Links

          Activity

          Hide
          hadoopqa Hadoop QA added a comment -



          -1 overall



          Vote Subsystem Runtime Comment
          0 pre-patch 18m 53s 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 appears to include 1 new or modified test files.
          +1 javac 7m 40s There were no new javac warning messages.
          +1 javadoc 9m 38s There were no new javadoc warning messages.
          +1 release audit 0m 23s The applied patch does not increase the total number of release audit warnings.
          +1 checkstyle 2m 12s There were no new checkstyle issues.
          +1 whitespace 0m 0s The patch has no lines that end in whitespace.
          +1 install 1m 24s mvn install still works.
          +1 eclipse:eclipse 0m 33s The patch built with eclipse:eclipse.
          +1 findbugs 4m 23s The patch does not introduce any new Findbugs (version 3.0.0) warnings.
          -1 common tests 22m 25s Tests failed in hadoop-common.
          -1 hdfs tests 174m 49s Tests failed in hadoop-hdfs.
              242m 23s  



          Reason Tests
          Failed unit tests hadoop.ha.TestZKFailoverController
            hadoop.net.TestNetUtils
          Timed out tests org.apache.hadoop.cli.TestHDFSCLI



          Subsystem Report/Notes
          Patch URL http://issues.apache.org/jira/secure/attachment/12750491/HDFS-8896.01.patch
          Optional Tests javadoc javac unit findbugs checkstyle
          git revision trunk / 84bf712
          hadoop-common test log https://builds.apache.org/job/PreCommit-HDFS-Build/11995/artifact/patchprocess/testrun_hadoop-common.txt
          hadoop-hdfs test log https://builds.apache.org/job/PreCommit-HDFS-Build/11995/artifact/patchprocess/testrun_hadoop-hdfs.txt
          Test Results https://builds.apache.org/job/PreCommit-HDFS-Build/11995/testReport/
          Java 1.7.0_55
          uname Linux asf909.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-HDFS-Build/11995/console

          This message was automatically generated.

          Show
          hadoopqa Hadoop QA added a comment - -1 overall Vote Subsystem Runtime Comment 0 pre-patch 18m 53s 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 appears to include 1 new or modified test files. +1 javac 7m 40s There were no new javac warning messages. +1 javadoc 9m 38s There were no new javadoc warning messages. +1 release audit 0m 23s The applied patch does not increase the total number of release audit warnings. +1 checkstyle 2m 12s There were no new checkstyle issues. +1 whitespace 0m 0s The patch has no lines that end in whitespace. +1 install 1m 24s mvn install still works. +1 eclipse:eclipse 0m 33s The patch built with eclipse:eclipse. +1 findbugs 4m 23s The patch does not introduce any new Findbugs (version 3.0.0) warnings. -1 common tests 22m 25s Tests failed in hadoop-common. -1 hdfs tests 174m 49s Tests failed in hadoop-hdfs.     242m 23s   Reason Tests Failed unit tests hadoop.ha.TestZKFailoverController   hadoop.net.TestNetUtils Timed out tests org.apache.hadoop.cli.TestHDFSCLI Subsystem Report/Notes Patch URL http://issues.apache.org/jira/secure/attachment/12750491/HDFS-8896.01.patch Optional Tests javadoc javac unit findbugs checkstyle git revision trunk / 84bf712 hadoop-common test log https://builds.apache.org/job/PreCommit-HDFS-Build/11995/artifact/patchprocess/testrun_hadoop-common.txt hadoop-hdfs test log https://builds.apache.org/job/PreCommit-HDFS-Build/11995/artifact/patchprocess/testrun_hadoop-hdfs.txt Test Results https://builds.apache.org/job/PreCommit-HDFS-Build/11995/testReport/ Java 1.7.0_55 uname Linux asf909.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-HDFS-Build/11995/console This message was automatically generated.
          Hide
          walter.k.su Walter Su added a comment -

          The failed tests failed before the patch(link). So it's not related.

          Show
          walter.k.su Walter Su added a comment - The failed tests failed before the patch( link ). So it's not related.
          Hide
          hudson Hudson added a comment -

          FAILURE: Integrated in Hadoop-trunk-Commit #8351 (See https://builds.apache.org/job/Hadoop-trunk-Commit/8351/)
          HDFS-8896. DataNode object isn't GCed when shutdown, because it has GC root in ShutdownHookManager. Contributed by Walter Su. (jing9: rev f44b599003bb79b1ec9b92e7546546523ec01676)

          • hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
          • hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/ShutdownHookManager.java
          • hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/MiniDFSCluster.java
          Show
          hudson Hudson added a comment - FAILURE: Integrated in Hadoop-trunk-Commit #8351 (See https://builds.apache.org/job/Hadoop-trunk-Commit/8351/ ) HDFS-8896 . DataNode object isn't GCed when shutdown, because it has GC root in ShutdownHookManager. Contributed by Walter Su. (jing9: rev f44b599003bb79b1ec9b92e7546546523ec01676) hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/ShutdownHookManager.java hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/MiniDFSCluster.java
          Hide
          jingzhao Jing Zhao added a comment -

          The patch looks good to me. +1. I've committed this to trunk and branch-2. Thanks Walter!

          Show
          jingzhao Jing Zhao added a comment - The patch looks good to me. +1. I've committed this to trunk and branch-2. Thanks Walter!
          Hide
          hudson Hudson added a comment -

          FAILURE: Integrated in Hadoop-Yarn-trunk-Java8 #312 (See https://builds.apache.org/job/Hadoop-Yarn-trunk-Java8/312/)
          HDFS-8896. DataNode object isn't GCed when shutdown, because it has GC root in ShutdownHookManager. Contributed by Walter Su. (jing9: rev f44b599003bb79b1ec9b92e7546546523ec01676)

          • hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/ShutdownHookManager.java
          • hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/MiniDFSCluster.java
          • hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
          Show
          hudson Hudson added a comment - FAILURE: Integrated in Hadoop-Yarn-trunk-Java8 #312 (See https://builds.apache.org/job/Hadoop-Yarn-trunk-Java8/312/ ) HDFS-8896 . DataNode object isn't GCed when shutdown, because it has GC root in ShutdownHookManager. Contributed by Walter Su. (jing9: rev f44b599003bb79b1ec9b92e7546546523ec01676) hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/ShutdownHookManager.java hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/MiniDFSCluster.java hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
          Hide
          hudson Hudson added a comment -

          FAILURE: Integrated in Hadoop-Yarn-trunk #1040 (See https://builds.apache.org/job/Hadoop-Yarn-trunk/1040/)
          HDFS-8896. DataNode object isn't GCed when shutdown, because it has GC root in ShutdownHookManager. Contributed by Walter Su. (jing9: rev f44b599003bb79b1ec9b92e7546546523ec01676)

          • hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
          • hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/MiniDFSCluster.java
          • hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/ShutdownHookManager.java
          Show
          hudson Hudson added a comment - FAILURE: Integrated in Hadoop-Yarn-trunk #1040 (See https://builds.apache.org/job/Hadoop-Yarn-trunk/1040/ ) HDFS-8896 . DataNode object isn't GCed when shutdown, because it has GC root in ShutdownHookManager. Contributed by Walter Su. (jing9: rev f44b599003bb79b1ec9b92e7546546523ec01676) hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/MiniDFSCluster.java hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/ShutdownHookManager.java
          Hide
          hudson Hudson added a comment -

          FAILURE: Integrated in Hadoop-Mapreduce-trunk #2256 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/2256/)
          HDFS-8896. DataNode object isn't GCed when shutdown, because it has GC root in ShutdownHookManager. Contributed by Walter Su. (jing9: rev f44b599003bb79b1ec9b92e7546546523ec01676)

          • hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/MiniDFSCluster.java
          • hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/ShutdownHookManager.java
          • hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
          Show
          hudson Hudson added a comment - FAILURE: Integrated in Hadoop-Mapreduce-trunk #2256 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/2256/ ) HDFS-8896 . DataNode object isn't GCed when shutdown, because it has GC root in ShutdownHookManager. Contributed by Walter Su. (jing9: rev f44b599003bb79b1ec9b92e7546546523ec01676) hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/MiniDFSCluster.java hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/ShutdownHookManager.java hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
          Hide
          hudson Hudson added a comment -

          SUCCESS: Integrated in Hadoop-Mapreduce-trunk-Java8 #307 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk-Java8/307/)
          HDFS-8896. DataNode object isn't GCed when shutdown, because it has GC root in ShutdownHookManager. Contributed by Walter Su. (jing9: rev f44b599003bb79b1ec9b92e7546546523ec01676)

          • hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/ShutdownHookManager.java
          • hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/MiniDFSCluster.java
          • hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
          Show
          hudson Hudson added a comment - SUCCESS: Integrated in Hadoop-Mapreduce-trunk-Java8 #307 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk-Java8/307/ ) HDFS-8896 . DataNode object isn't GCed when shutdown, because it has GC root in ShutdownHookManager. Contributed by Walter Su. (jing9: rev f44b599003bb79b1ec9b92e7546546523ec01676) hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/ShutdownHookManager.java hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/MiniDFSCluster.java hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
          Hide
          hudson Hudson added a comment -

          FAILURE: Integrated in Hadoop-Hdfs-trunk #2237 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/2237/)
          HDFS-8896. DataNode object isn't GCed when shutdown, because it has GC root in ShutdownHookManager. Contributed by Walter Su. (jing9: rev f44b599003bb79b1ec9b92e7546546523ec01676)

          • hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/ShutdownHookManager.java
          • hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
          • hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/MiniDFSCluster.java
          Show
          hudson Hudson added a comment - FAILURE: Integrated in Hadoop-Hdfs-trunk #2237 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/2237/ ) HDFS-8896 . DataNode object isn't GCed when shutdown, because it has GC root in ShutdownHookManager. Contributed by Walter Su. (jing9: rev f44b599003bb79b1ec9b92e7546546523ec01676) hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/ShutdownHookManager.java hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/MiniDFSCluster.java
          Hide
          hudson Hudson added a comment -

          FAILURE: Integrated in Hadoop-Hdfs-trunk-Java8 #299 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk-Java8/299/)
          HDFS-8896. DataNode object isn't GCed when shutdown, because it has GC root in ShutdownHookManager. Contributed by Walter Su. (jing9: rev f44b599003bb79b1ec9b92e7546546523ec01676)

          • hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
          • hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/MiniDFSCluster.java
          • hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/ShutdownHookManager.java
          Show
          hudson Hudson added a comment - FAILURE: Integrated in Hadoop-Hdfs-trunk-Java8 #299 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk-Java8/299/ ) HDFS-8896 . DataNode object isn't GCed when shutdown, because it has GC root in ShutdownHookManager. Contributed by Walter Su. (jing9: rev f44b599003bb79b1ec9b92e7546546523ec01676) hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/MiniDFSCluster.java hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/ShutdownHookManager.java

            People

            • Assignee:
              walter.k.su Walter Su
              Reporter:
              walter.k.su Walter Su
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development