Repository: hbase Updated Branches: refs/heads/master 60f537889 -> 75c94c6bb
HBASE-11551 BucketCache.run() doesn't handle exceptions correctly (Ted Yu) Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/75c94c6b Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/75c94c6b Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/75c94c6b Branch: refs/heads/master Commit: 75c94c6bb50c46c62843974976b77b4b44ce23a4 Parents: 60f5378 Author: Ted Yu <te...@apache.org> Authored: Thu Jul 24 00:59:10 2014 +0000 Committer: Ted Yu <te...@apache.org> Committed: Thu Jul 24 00:59:10 2014 +0000 ---------------------------------------------------------------------- .../hbase/io/hfile/bucket/BucketCache.java | 22 ++++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hbase/blob/75c94c6b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/bucket/BucketCache.java ---------------------------------------------------------------------- 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 11979be..9a8cf5a 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); @@ -1286,4 +1290,4 @@ public class BucketCache implements BlockCache, HeapSize { public BlockCache[] getBlockCaches() { return null; } -} \ No newline at end of file +}