hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject hbase git commit: HBASE-17381 ReplicationSourceWorkerThread can die due to unhandled exceptions (huzheng)
Date Wed, 08 Feb 2017 01:07:12 GMT
Repository: hbase
Updated Branches:
  refs/heads/master c55fce00f -> d8f3c6cff


HBASE-17381 ReplicationSourceWorkerThread can die due to unhandled exceptions (huzheng)

Signed-off-by: Gary Helmling <garyh@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/d8f3c6cf
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/d8f3c6cf
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/d8f3c6cf

Branch: refs/heads/master
Commit: d8f3c6cff93c62d68ac3f68703bad86deaa03f14
Parents: c55fce0
Author: huzheng <openinx@gmail.com>
Authored: Mon Feb 6 11:20:11 2017 +0800
Committer: Gary Helmling <garyh@apache.org>
Committed: Tue Feb 7 16:39:14 2017 -0800

----------------------------------------------------------------------
 .../org/apache/hadoop/hbase/regionserver/RSRpcServices.java    | 6 +++++-
 .../hbase/replication/regionserver/ReplicationSource.java      | 3 +++
 2 files changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/d8f3c6cf/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java
index 2dcd60a..b0ae016 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java
@@ -1334,6 +1334,10 @@ public class RSRpcServices implements HBaseRPCErrorHandler,
    */
   @Override
   public boolean checkOOME(final Throwable e) {
+    return exitIfOOME(e);
+  }
+
+  public static boolean exitIfOOME(final Throwable e ){
     boolean stop = false;
     try {
       if (e instanceof OutOfMemoryError
@@ -1341,7 +1345,7 @@ public class RSRpcServices implements HBaseRPCErrorHandler,
           || (e.getMessage() != null && e.getMessage().contains(
               "java.lang.OutOfMemoryError"))) {
         stop = true;
-        LOG.fatal("Run out of memory; " + getClass().getSimpleName()
+        LOG.fatal("Run out of memory; " + RSRpcServices.class.getSimpleName()
           + " will abort itself immediately", e);
       }
     } finally {

http://git-wip-us.apache.org/repos/asf/hbase/blob/d8f3c6cf/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java
index 124c340..5ef573a 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java
@@ -53,6 +53,7 @@ import org.apache.hadoop.hbase.MetaTableAccessor;
 import org.apache.hadoop.hbase.Stoppable;
 import org.apache.hadoop.hbase.TableName;
 import org.apache.hadoop.hbase.classification.InterfaceAudience;
+import org.apache.hadoop.hbase.regionserver.RSRpcServices;
 import org.apache.hadoop.hbase.regionserver.wal.WALEdit;
 import org.apache.hadoop.hbase.replication.ChainWALEntryFilter;
 import org.apache.hadoop.hbase.replication.ClusterMarkingEntryFilter;
@@ -778,8 +779,10 @@ public class ReplicationSource extends Thread implements ReplicationSourceInterf
       Thread.UncaughtExceptionHandler handler = new Thread.UncaughtExceptionHandler() {
         @Override
         public void uncaughtException(final Thread t, final Throwable e) {
+          RSRpcServices.exitIfOOME(e);
           LOG.error("Unexpected exception in ReplicationSourceWorkerThread," + " currentPath="
               + getCurrentPath(), e);
+          stopper.stop("Unexpected exception in ReplicationSourceWorkerThread");
         }
       };
       Threads.setDaemonThreadRunning(this, n + ".replicationSource." + walGroupId + ","


Mime
View raw message