HDFS-3919. MiniDFSCluster:waitClusterUp can hang forever. Contributed by Andy Isaacson
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1383761 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
08f061b366
commit
797e4760d9
|
@ -15,6 +15,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
|
||||
|
|
|
@ -916,7 +916,8 @@ public class MiniDFSCluster {
|
|||
/**
|
||||
* 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 {
|
||||
|
@ -924,6 +925,9 @@ public class MiniDFSCluster {
|
|||
Thread.sleep(1000);
|
||||
} catch (InterruptedException e) {
|
||||
}
|
||||
if (++i > 10) {
|
||||
throw new IOException("Timed out waiting for Mini HDFS Cluster to start");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue