From ac08b992c5c85e5ab4e6062a19b66d7478ee5980 Mon Sep 17 00:00:00 2001 From: anoopsjohn Date: Mon, 27 Jul 2015 16:01:23 +0530 Subject: [PATCH] HBASE-14156 Fix test failure in TestOpenTableInCoprocessor. --- .../hadoop/hbase/regionserver/RSRpcServices.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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 7c29b3cf6de..65cedeeae03 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 @@ -658,7 +658,11 @@ public class RSRpcServices implements HBaseRPCErrorHandler, Result r = null; if (action.hasGet()) { Get get = ProtobufUtil.toGet(action.getGet()); - r = get(get, ((HRegion) region), closeCallBack, context); + if (context != null) { + r = get(get, ((HRegion) region), closeCallBack, context); + } else { + r = region.get(get); + } } else if (action.hasServiceCall()) { resultOrExceptionBuilder = ResultOrException.newBuilder(); try { @@ -2078,7 +2082,7 @@ public class RSRpcServices implements HBaseRPCErrorHandler, RegionActionResult.Builder regionActionResultBuilder = RegionActionResult.newBuilder(); Boolean processed = null; RegionScannersCloseCallBack closeCallBack = null; - RpcCallContext context = null; + RpcCallContext context = RpcServer.getCurrentCall(); for (RegionAction regionAction : request.getRegionActionList()) { this.requestCount.add(regionAction.getActionCount()); OperationQuota quota; @@ -2125,12 +2129,11 @@ public class RSRpcServices implements HBaseRPCErrorHandler, } } else { // doNonAtomicRegionMutation manages the exception internally - if (closeCallBack == null) { + if (context != null && closeCallBack == null) { // An RpcCallBack that creates a list of scanners that needs to perform callBack // operation on completion of multiGets. // Set this only once closeCallBack = new RegionScannersCloseCallBack(); - context = RpcServer.getCurrentCall(); context.setCallBack(closeCallBack); } cellsToReturn = doNonAtomicRegionMutation(region, quota, regionAction, cellScanner,