You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by ap...@apache.org on 2014/07/11 22:58:21 UTC
git commit: HBASE-11460 Deadlock in HMaster on masterAndZKLock in
HConnectionManager (Ted Yu)
Repository: hbase
Updated Branches:
refs/heads/0.98 ca219267c -> f60e0bd8f
HBASE-11460 Deadlock in HMaster on masterAndZKLock in HConnectionManager (Ted Yu)
Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/f60e0bd8
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/f60e0bd8
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/f60e0bd8
Branch: refs/heads/0.98
Commit: f60e0bd8f3e38c58b95ab0c746a66c595f234653
Parents: ca21926
Author: Andrew Purtell <ap...@apache.org>
Authored: Fri Jul 11 13:52:16 2014 -0700
Committer: Andrew Purtell <ap...@apache.org>
Committed: Fri Jul 11 13:52:16 2014 -0700
----------------------------------------------------------------------
.../org/apache/hadoop/hbase/client/HConnectionManager.java | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hbase/blob/f60e0bd8/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java
index 003bc8e..7f5f80b 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java
@@ -1747,7 +1747,7 @@ public class HConnectionManager {
}
private ZooKeeperKeepAliveConnection keepAliveZookeeper;
- private int keepAliveZookeeperUserCount;
+ private AtomicInteger keepAliveZookeeperUserCount = new AtomicInteger(0);
private boolean canCloseZKW = true;
// keepAlive time, in ms. No reason to make it configurable.
@@ -1768,7 +1768,7 @@ public class HConnectionManager {
// But there is a retry mechanism in the ZooKeeperWatcher itself
keepAliveZookeeper = new ZooKeeperKeepAliveConnection(conf, this.toString(), this);
}
- keepAliveZookeeperUserCount++;
+ keepAliveZookeeperUserCount.incrementAndGet();
keepZooKeeperWatcherAliveUntil = Long.MAX_VALUE;
return keepAliveZookeeper;
}
@@ -1779,8 +1779,7 @@ public class HConnectionManager {
return;
}
synchronized (masterAndZKLock) {
- --keepAliveZookeeperUserCount;
- if (keepAliveZookeeperUserCount <= 0 ){
+ if (keepAliveZookeeperUserCount.decrementAndGet() <= 0 ){
keepZooKeeperWatcherAliveUntil = System.currentTimeMillis() + keepAlive;
}
}
@@ -1860,7 +1859,7 @@ public class HConnectionManager {
keepAliveZookeeper.internalClose();
keepAliveZookeeper = null;
}
- keepAliveZookeeperUserCount = 0;
+ keepAliveZookeeperUserCount.set(0);
}
}