HBASE-11551 BucketCache.run() doesn't handle exceptions correctly

This commit is contained in:
stack 2014-07-23 07:34:51 -07:00
parent 4c3fce8e4a
commit afd4eb6668
1 changed files with 12 additions and 8 deletions

View File

@ -688,16 +688,20 @@ public class BucketCache implements BlockCache, HeapSize {
try {
while (cacheEnabled && writerEnabled) {
try {
// Blocks
entries.add(inputQueue.take());
inputQueue.drainTo(entries);
synchronized (cacheWaitSignals[threadNO]) {
cacheWaitSignals[threadNO].notifyAll();
try {
// Blocks
entries.add(inputQueue.take());
inputQueue.drainTo(entries);
synchronized (cacheWaitSignals[threadNO]) {
cacheWaitSignals[threadNO].notifyAll();
}
} catch (InterruptedException ie) {
if (!cacheEnabled) break;
}
} catch (InterruptedException ie) {
if (!cacheEnabled) break;
doDrain(entries);
} catch (Exception ioe) {
LOG.error("WriterThread encountered error", ioe);
}
doDrain(entries);
}
} catch (Throwable t) {
LOG.warn("Failed doing drain", t);