HBASE-24972 Wait for connection attempt to succeed before performing operations on ZK

This commit is contained in:
gvprathyusha6 2021-01-11 01:45:23 +05:30
parent 686b72c44e
commit 1554faa3a5
1 changed files with 1 additions and 0 deletions

View File

@ -135,6 +135,7 @@ public class RecoverableZooKeeper {
if (this.zk == null) { if (this.zk == null) {
try { try {
this.zk = new ZooKeeper(quorumServers, sessionTimeout, watcher); this.zk = new ZooKeeper(quorumServers, sessionTimeout, watcher);
ZooKeeperHelper.ensureConnectedZooKeeper(this.zk, 30000);
} catch (IOException ex) { } catch (IOException ex) {
LOG.warn("Unable to create ZooKeeper Connection", ex); LOG.warn("Unable to create ZooKeeper Connection", ex);
throw new KeeperException.OperationTimeoutException(); throw new KeeperException.OperationTimeoutException();