hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject hbase git commit: HBASE-12951 TestHCM.testConnectionClose is flakey when using AsyncRpcClient as client implementation
Date Mon, 02 Feb 2015 16:28:11 GMT
Repository: hbase
Updated Branches:
  refs/heads/master 86b8b8da0 -> fef78acf6


HBASE-12951 TestHCM.testConnectionClose is flakey when using AsyncRpcClient as client implementation

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


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

Branch: refs/heads/master
Commit: fef78acf6534f6736c10d2054cf8cb479edd3291
Parents: 86b8b8d
Author: zhangduo <zhangduo@wandoujia.com>
Authored: Mon Feb 2 11:46:22 2015 +0800
Committer: stack <stack@apache.org>
Committed: Mon Feb 2 08:27:57 2015 -0800

----------------------------------------------------------------------
 .../java/org/apache/hadoop/hbase/ipc/AsyncRpcChannel.java   | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/fef78acf/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/AsyncRpcChannel.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/AsyncRpcChannel.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/AsyncRpcChannel.java
index 0be4cd4..7069a42 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/AsyncRpcChannel.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/AsyncRpcChannel.java
@@ -108,7 +108,7 @@ public class AsyncRpcChannel {
   private Token<? extends TokenIdentifier> token;
   private String serverPrincipal;
 
-  boolean shouldCloseConnection = false;
+  volatile boolean shouldCloseConnection = false;
   private IOException closeException;
 
   private Timeout cleanupTimer;
@@ -313,6 +313,13 @@ public class AsyncRpcChannel {
 
     calls.put(call.id, call);
 
+    // check again, see https://issues.apache.org/jira/browse/HBASE-12951
+    if (shouldCloseConnection) {
+      Promise<Message> promise = channel.eventLoop().newPromise();
+      promise.setFailure(new ConnectException());
+      return promise;
+    }
+
     // Add timeout for cleanup if none is present
     if (cleanupTimer == null) {
       cleanupTimer = AsyncRpcClient.WHEEL_TIMER.newTimeout(timeoutTask, call.getRpcTimeout(),


Mime
View raw message