Skip to content

Commit 02d263e

Browse files
committed
HDFS-3266. DFSTestUtil#waitCorruptReplicas doesn't sleep between checks. Contributed by Madhukara Phatak.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1346192 13f79535-47bb-0310-9956-ffa450edef68
1 parent 96bd33f commit 02d263e

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,9 @@ Release 2.0.1-alpha - UNRELEASED
304304
HDFS-3501. Checkpointing with security enabled will stop working
305305
after ticket lifetime expires. (atm via eli)
306306

307+
HDFS-3266. DFSTestUtil#waitCorruptReplicas doesn't sleep between checks.
308+
(Madhukara Phatak via atm)
309+
307310
Release 2.0.0-alpha - 05-23-2012
308311

309312
INCOMPATIBLE CHANGES

hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/DFSTestUtil.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ public static void waitForReplication(MiniDFSCluster cluster, ExtendedBlock b,
323323
*/
324324
public static void waitCorruptReplicas(FileSystem fs, FSNamesystem ns,
325325
Path file, ExtendedBlock b, int corruptRepls)
326-
throws IOException, TimeoutException {
326+
throws IOException, TimeoutException, InterruptedException {
327327
int count = 0;
328328
final int ATTEMPTS = 50;
329329
int repls = ns.getBlockManager().numCorruptReplicas(b.getLocalBlock());
@@ -337,6 +337,7 @@ public static void waitCorruptReplicas(FileSystem fs, FSNamesystem ns,
337337
System.out.println("Waiting for "+corruptRepls+" corrupt replicas");
338338
repls = ns.getBlockManager().numCorruptReplicas(b.getLocalBlock());
339339
count++;
340+
Thread.sleep(1000);
340341
}
341342
if (count == ATTEMPTS) {
342343
throw new TimeoutException("Timed out waiting for corrupt replicas."

0 commit comments

Comments
 (0)