diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/bucket/BucketCache.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/bucket/BucketCache.java index e3a81180bac..3439cc111d0 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/bucket/BucketCache.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/bucket/BucketCache.java @@ -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);