Repository: hbase
Updated Branches:
  refs/heads/branch-1.3 57c70a98f -> d6cf38964


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/d6cf3896
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/d6cf3896
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/d6cf3896

Branch: refs/heads/branch-1.3
Commit: d6cf3896478146ebfed67ef975882499350e5431
Parents: 57c70a9
Author: Abhishek Singh Chouhan <achou...@apache.org>
Authored: Tue Mar 6 16:34:32 2018 +0530
Committer: Abhishek Singh Chouhan <achou...@apache.org>
Committed: Wed Mar 7 12:14:21 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/d6cf3896/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 5a495ed..b19d5a1 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
@@ -2226,9 +2226,12 @@ public class RSRpcServices implements 
HBaseRPCErrorHandler,
     } catch (IOException ie) {
       throw new ServiceException(ie);
     } finally {
-      if (regionServer.metricsRegionServer != 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