HBASE-11460 Deadlock in HMaster on masterAndZKLock in HConnectionManager
This commit is contained in:
parent
79676f15f4
commit
b3da98a1a2
@ -1594,7 +1594,7 @@ class ConnectionManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private ZooKeeperKeepAliveConnection keepAliveZookeeper;
|
private ZooKeeperKeepAliveConnection keepAliveZookeeper;
|
||||||
private int keepAliveZookeeperUserCount;
|
private AtomicInteger keepAliveZookeeperUserCount = new AtomicInteger(0);
|
||||||
private boolean canCloseZKW = true;
|
private boolean canCloseZKW = true;
|
||||||
|
|
||||||
// keepAlive time, in ms. No reason to make it configurable.
|
// keepAlive time, in ms. No reason to make it configurable.
|
||||||
@ -1615,7 +1615,7 @@ class ConnectionManager {
|
|||||||
// But there is a retry mechanism in the ZooKeeperWatcher itself
|
// But there is a retry mechanism in the ZooKeeperWatcher itself
|
||||||
keepAliveZookeeper = new ZooKeeperKeepAliveConnection(conf, this.toString(), this);
|
keepAliveZookeeper = new ZooKeeperKeepAliveConnection(conf, this.toString(), this);
|
||||||
}
|
}
|
||||||
keepAliveZookeeperUserCount++;
|
keepAliveZookeeperUserCount.addAndGet(1);
|
||||||
keepZooKeeperWatcherAliveUntil = Long.MAX_VALUE;
|
keepZooKeeperWatcherAliveUntil = Long.MAX_VALUE;
|
||||||
return keepAliveZookeeper;
|
return keepAliveZookeeper;
|
||||||
}
|
}
|
||||||
@ -1625,11 +1625,8 @@ class ConnectionManager {
|
|||||||
if (zkw == null){
|
if (zkw == null){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
synchronized (masterAndZKLock) {
|
if (keepAliveZookeeperUserCount.addAndGet(-1) <= 0 ){
|
||||||
--keepAliveZookeeperUserCount;
|
keepZooKeeperWatcherAliveUntil = System.currentTimeMillis() + keepAlive;
|
||||||
if (keepAliveZookeeperUserCount <= 0 ){
|
|
||||||
keepZooKeeperWatcherAliveUntil = System.currentTimeMillis() + keepAlive;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1707,7 +1704,7 @@ class ConnectionManager {
|
|||||||
keepAliveZookeeper.internalClose();
|
keepAliveZookeeper.internalClose();
|
||||||
keepAliveZookeeper = null;
|
keepAliveZookeeper = null;
|
||||||
}
|
}
|
||||||
keepAliveZookeeperUserCount = 0;
|
keepAliveZookeeperUserCount.set(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user