diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index 5aafbe622a..036609ad4e 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -230,6 +230,9 @@ Release 2.0.3-alpha - Unreleased BUG FIXES + HDFS-3919. MiniDFSCluster:waitClusterUp can hang forever. + (Andy Isaacson via eli) + Release 2.0.2-alpha - 2012-09-07 INCOMPATIBLE CHANGES diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/MiniDFSCluster.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/MiniDFSCluster.java index 7848346679..9d9b5c2448 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/MiniDFSCluster.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/MiniDFSCluster.java @@ -918,7 +918,8 @@ public void waitNameNodeUp(int nnIndex) { /** * wait for the cluster to get out of safemode. */ - public void waitClusterUp() { + public void waitClusterUp() throws IOException { + int i = 0; if (numDataNodes > 0) { while (!isClusterUp()) { try { @@ -926,6 +927,9 @@ public void waitClusterUp() { Thread.sleep(1000); } catch (InterruptedException e) { } + if (++i > 10) { + throw new IOException("Timed out waiting for Mini HDFS Cluster to start"); + } } } }