Repository: hbase
Updated Branches:
  refs/heads/branch-1 ac6af9f43 -> 41ff229a1


HBASE-20139 NPE in RSRpcServices.get() when getRegion throws an exception


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

Branch: refs/heads/branch-1
Commit: 41ff229a1605808e009d87c7bca5d34a6c2897de
Parents: ac6af9f
Author: Abhishek Singh Chouhan <achou...@apache.org>
Authored: Tue Mar 6 16:26:31 2018 +0530
Committer: Abhishek Singh Chouhan <achou...@apache.org>
Committed: Wed Mar 7 12:09:04 2018 +0530

----------------------------------------------------------------------
 .../org/apache/hadoop/hbase/regionserver/RSRpcServices.java | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/41ff229a/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 9da4cbb..1fbc412 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
@@ -2328,9 +2328,12 @@ public class RSRpcServices implements 
HBaseRPCErrorHandler,
     } catch (IOException ie) {
       throw new ServiceException(ie);
     } finally {
-      if (regionServer.metricsRegionServer != null && region != null) {
-        regionServer.metricsRegionServer.updateGet(
-            region.getTableDesc().getTableName(), 
EnvironmentEdgeManager.currentTime() - before);
+      MetricsRegionServer mrs = regionServer.metricsRegionServer;
+      if (mrs != null) {
+        HTableDescriptor td = region != null ? region.getTableDesc() : null;
+        if (td != null) {
+          mrs.updateGet(td.getTableName(), 
EnvironmentEdgeManager.currentTime() - before);
+        }
       }
       if (quota != null) {
         quota.close();

Reply via email to