From 09d9dc4b594674d77fb344466daaabc3eab21da0 Mon Sep 17 00:00:00 2001 From: Yu Li Date: Sat, 9 Jul 2016 01:05:10 +0800 Subject: [PATCH] HBASE-16201 NPE in RpcServer causing intermittent UT failure of TestMasterReplication#testHFileCyclicReplication --- .../main/java/org/apache/hadoop/hbase/ipc/RpcServer.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcServer.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcServer.java index 02fe1df4b92..404f2ec0cf0 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcServer.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcServer.java @@ -2298,7 +2298,13 @@ public class RpcServer implements RpcServerInterface, ConfigurationObserver { // The above callBlockingMethod will always return a SE. Strip the SE wrapper before // putting it on the wire. Its needed to adhere to the pb Service Interface but we don't // need to pass it over the wire. - if (e instanceof ServiceException) e = e.getCause(); + if (e instanceof ServiceException) { + if (e.getCause() == null) { + LOG.debug("Caught a ServiceException with null cause", e); + } else { + e = e.getCause(); + } + } // increment the number of requests that were exceptions. metrics.exception(e);