HBASE-17381 ReplicationSourceWorkerThread can die due to unhandled exceptions (huzheng)
Signed-off-by: Gary Helmling <garyh@apache.org>
This commit is contained in:
parent
a75e5a5435
commit
8574934f59
|
@ -1228,6 +1228,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
|
||||
|
@ -1235,7 +1239,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 {
|
||||
|
|
|
@ -58,6 +58,7 @@ import org.apache.hadoop.hbase.classification.InterfaceAudience;
|
|||
import org.apache.hadoop.hbase.protobuf.generated.WALProtos;
|
||||
import org.apache.hadoop.hbase.protobuf.generated.WALProtos.BulkLoadDescriptor;
|
||||
import org.apache.hadoop.hbase.protobuf.generated.WALProtos.StoreDescriptor;
|
||||
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.ReplicationEndpoint;
|
||||
|
@ -1289,8 +1290,10 @@ public class ReplicationSource extends Thread
|
|||
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 + ","
|
||||
|
|
Loading…
Reference in New Issue