You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by jm...@apache.org on 2015/05/20 01:14:42 UTC

[47/50] [abbrv] hbase git commit: HBASE-13694 CallQueueSize is incorrectly decremented until the response is sent

HBASE-13694 CallQueueSize is incorrectly decremented until the response is sent

Signed-off-by: stack <st...@apache.org>


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

Branch: refs/heads/hbase-11339
Commit: 74e5b26e57ef8d31723ff05ff913bad7f92a7518
Parents: 5e7e626
Author: Esteban Gutierrez <es...@cloudera.com>
Authored: Fri May 15 00:57:15 2015 -0700
Committer: stack <st...@apache.org>
Committed: Tue May 19 09:22:31 2015 -0700

----------------------------------------------------------------------
 .../main/java/org/apache/hadoop/hbase/ipc/CallRunner.java | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/74e5b26e/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/CallRunner.java
----------------------------------------------------------------------
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..26ffa95 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 sucessful;
 
   /**
    * 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);
+          sucessful = 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 (!sucessful) {
+        this.rpcServer.addCallSize(call.getSize() * -1);
+      }
       cleanup();
     }
   }