HBASE-11551 BucketCache.run() doesn't handle exceptions correctly (Ted Yu)
This commit is contained in:
parent
60f5378895
commit
75c94c6bb5
|
@ -688,16 +688,20 @@ public class BucketCache implements BlockCache, HeapSize {
|
||||||
try {
|
try {
|
||||||
while (cacheEnabled && writerEnabled) {
|
while (cacheEnabled && writerEnabled) {
|
||||||
try {
|
try {
|
||||||
// Blocks
|
try {
|
||||||
entries.add(inputQueue.take());
|
// Blocks
|
||||||
inputQueue.drainTo(entries);
|
entries.add(inputQueue.take());
|
||||||
synchronized (cacheWaitSignals[threadNO]) {
|
inputQueue.drainTo(entries);
|
||||||
cacheWaitSignals[threadNO].notifyAll();
|
synchronized (cacheWaitSignals[threadNO]) {
|
||||||
|
cacheWaitSignals[threadNO].notifyAll();
|
||||||
|
}
|
||||||
|
} catch (InterruptedException ie) {
|
||||||
|
if (!cacheEnabled) break;
|
||||||
}
|
}
|
||||||
} catch (InterruptedException ie) {
|
doDrain(entries);
|
||||||
if (!cacheEnabled) break;
|
} catch (Exception ioe) {
|
||||||
|
LOG.error("WriterThread encountered error", ioe);
|
||||||
}
|
}
|
||||||
doDrain(entries);
|
|
||||||
}
|
}
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
LOG.warn("Failed doing drain", t);
|
LOG.warn("Failed doing drain", t);
|
||||||
|
|
Loading…
Reference in New Issue