Repository: hbase
Updated Branches:
  refs/heads/0.98 e426d43e8 -> 76e89cb7f


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/76e89cb7
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/76e89cb7
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/76e89cb7

Branch: refs/heads/0.98
Commit: 76e89cb7fface4d91b8c62192832be581bf67a3b
Parents: e426d43
Author: Ted Yu <te...@apache.org>
Authored: Wed Jul 30 19:43:38 2014 +0000
Committer: Ted Yu <te...@apache.org>
Committed: Wed Jul 30 19:43:38 2014 +0000

----------------------------------------------------------------------
 .../hbase/io/hfile/bucket/BucketCache.java      | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/76e89cb7/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 3614dc4..17d178e 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
@@ -685,16 +685,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);

Reply via email to