HBASE-14458 AsyncRpcClient#createRpcChannel() should check and remove dead channel before creating new one to same server (Samir Ahmic)
Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/8e6316a8 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/8e6316a8 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/8e6316a8 Branch: refs/heads/hbase-12439 Commit: 8e6316a80cf96f4d4cd6bd10f4c647ebf45c7e02 Parents: f1b6355 Author: tedyu <yuzhih...@gmail.com> Authored: Sun Oct 18 20:49:31 2015 -0700 Committer: tedyu <yuzhih...@gmail.com> Committed: Sun Oct 18 20:49:31 2015 -0700 ---------------------------------------------------------------------- .../main/java/org/apache/hadoop/hbase/ipc/AsyncRpcClient.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hbase/blob/8e6316a8/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/AsyncRpcClient.java ---------------------------------------------------------------------- diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/AsyncRpcClient.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/AsyncRpcClient.java index 60e9add..f972d0e 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/AsyncRpcClient.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/AsyncRpcClient.java @@ -386,7 +386,11 @@ public class AsyncRpcClient extends AbstractRpcClient { throw new StoppedRpcClientException(); } rpcChannel = connections.get(hashCode); - if (rpcChannel == null || !rpcChannel.isAlive()) { + if (rpcChannel != null && !rpcChannel.isAlive()) { + LOG.debug("Removing dead channel from server="+rpcChannel.address.toString()); + connections.remove(hashCode); + } + if (rpcChannel == null) { rpcChannel = new AsyncRpcChannel(this.bootstrap, this, ticket, serviceName, location); connections.put(hashCode, rpcChannel); }