From 7e3776ca6e9a2033cfad14ff5a224460ad59087e Mon Sep 17 00:00:00 2001 From: Eli Collins Date: Tue, 18 Sep 2012 16:59:47 +0000 Subject: [PATCH] HDFS-3936. MiniDFSCluster shutdown races with BlocksMap usage. Contributed by Eli Collins git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1387255 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 2 ++ .../apache/hadoop/hdfs/server/blockmanagement/BlocksMap.java | 2 +- .../java/org/apache/hadoop/hdfs/TestDFSClientRetries.java | 2 +- .../src/test/java/org/apache/hadoop/hdfs/web/TestWebHDFS.java | 4 ++-- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index 3eeede2737..541f888bfa 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -242,6 +242,8 @@ Release 2.0.3-alpha - Unreleased HDFS-3924. Multi-byte id in HdfsVolumeId. (Andrew Wang via atm) + HDFS-3936. MiniDFSCluster shutdown races with BlocksMap usage. (eli) + Release 2.0.2-alpha - 2012-09-07 INCOMPATIBLE CHANGES diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlocksMap.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlocksMap.java index e6b503781a..ef21dc3a33 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlocksMap.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlocksMap.java @@ -94,7 +94,7 @@ private static int computeCapacity() { } void close() { - blocks = null; + // Empty blocks once GSet#clear is implemented (HDFS-3940) } BlockCollection getBlockCollection(Block b) { diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDFSClientRetries.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDFSClientRetries.java index 815e7e19ac..2e9deee05a 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDFSClientRetries.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDFSClientRetries.java @@ -830,7 +830,7 @@ public void testRetryOnChecksumFailure() throws Exception { } /** Test client retry with namenode restarting. */ - @Test + @Test(timeout=300000) public void testNamenodeRestart() throws Exception { namenodeRestartTest(new Configuration(), false); } diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/web/TestWebHDFS.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/web/TestWebHDFS.java index 8d9f1ea0d3..969ad5c1fb 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/web/TestWebHDFS.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/web/TestWebHDFS.java @@ -80,7 +80,7 @@ String toMpsString(final long nBytes, final long now) { } } - @Test + @Test(timeout=300000) public void testLargeFile() throws Exception { largeFileTest(200L << 20); //200MB file length } @@ -202,7 +202,7 @@ static void verifyPread(FileSystem fs, Path p, long offset, long length, } /** Test client retry with namenode restarting. */ - @Test + @Test(timeout=300000) public void testNamenodeRestart() throws Exception { ((Log4JLogger)NamenodeWebHdfsMethods.LOG).getLogger().setLevel(Level.ALL); final Configuration conf = WebHdfsTestUtil.createConf();