HDFS-6783. Addendum patch to fix test failures. (Contributed by Yi Liu)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1618635 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Arpit Agarwal 2014-08-18 15:34:58 +00:00
parent 519c4be95a
commit 1c77c80410
1 changed files with 11 additions and 11 deletions

View File

@ -286,19 +286,19 @@ public class CacheReplicationMonitor extends Thread implements Closeable {
private void rescan() throws InterruptedException { private void rescan() throws InterruptedException {
scannedDirectives = 0; scannedDirectives = 0;
scannedBlocks = 0; scannedBlocks = 0;
namesystem.writeLock();
try { try {
lock.lock(); namesystem.writeLock();
if (shutdown) { try {
throw new InterruptedException("CacheReplicationMonitor was " + lock.lock();
"shut down."); if (shutdown) {
throw new InterruptedException("CacheReplicationMonitor was " +
"shut down.");
}
curScanCount = completedScanCount + 1;
} finally {
lock.unlock();
} }
curScanCount = completedScanCount + 1;
}
finally {
lock.unlock();
}
try {
resetStatistics(); resetStatistics();
rescanCacheDirectives(); rescanCacheDirectives();
rescanCachedBlockMap(); rescanCachedBlockMap();