From bb1e24a2bb968b87c3d8c7146174018c58ed9719 Mon Sep 17 00:00:00 2001 From: Esteban Gutierrez Date: Fri, 15 May 2015 00:57:15 -0700 Subject: [PATCH] HBASE-13694 CallQueueSize is incorrectly decremented until the response is sent --- .../src/main/java/org/apache/hadoop/hbase/ipc/CallRunner.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/CallRunner.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/CallRunner.java index fd4de3a..04964f0 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/CallRunner.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/CallRunner.java @@ -45,6 +45,7 @@ public class CallRunner { private Call call; private RpcServerInterface rpcServer; private MonitoredRPCHandler status; + private volatile boolean isSuccessful; /** * On construction, adds the size of this call to the running count of outstanding call sizes. @@ -116,6 +117,10 @@ public class CallRunner { traceScope.close(); } RpcServer.CurCall.set(null); + if (resultPair != null) { + this.rpcServer.addCallSize(call.getSize() * -1); + isSuccessful = true; + } } // Set the response for undelayed calls and delayed calls with // undelayed responses. @@ -146,8 +151,9 @@ public class CallRunner { RpcServer.LOG.warn(Thread.currentThread().getName() + ": caught: " + StringUtils.stringifyException(e)); } finally { - // regardless if successful or not we need to reset the callQueueSize - this.rpcServer.addCallSize(call.getSize() * -1); + if (!isSuccessful) { + this.rpcServer.addCallSize(call.getSize() * -1); + } cleanup(); } } -- 2.4.0