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

This commit is contained in:
Abhishek Singh Chouhan 2018-03-06 16:26:31 +05:30
parent ac6af9f43a
commit 41ff229a16
1 changed files with 6 additions and 3 deletions

View File

@ -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();