HBASE-21357 RS should abort if OOM in Reader thread

This commit is contained in:
Allan Yang 2018-10-24 11:10:20 +08:00
parent f73d6193e1
commit 5f5f4e82b1
1 changed files with 11 additions and 0 deletions

View File

@ -732,6 +732,17 @@ public class RpcServer implements RpcServerInterface, ConfigurationObserver {
LOG.error(getName() + ": CancelledKeyException in Reader", e);
} catch (IOException ex) {
LOG.info(getName() + ": IOException in Reader", ex);
} catch (OutOfMemoryError e) {
if (getErrorHandler() != null) {
if (getErrorHandler().checkOOME(e)) {
RpcServer.LOG.info(Thread.currentThread().getName()
+ ": exiting on OutOfMemoryError");
return;
}
} else {
// rethrow if no handler
throw e;
}
}
}
}