From 1554faa3a514c52d20d787eae5288c1da18546b4 Mon Sep 17 00:00:00 2001 From: gvprathyusha6 Date: Mon, 11 Jan 2021 01:45:23 +0530 Subject: [PATCH] HBASE-24972 Wait for connection attempt to succeed before performing operations on ZK --- .../org/apache/hadoop/hbase/zookeeper/RecoverableZooKeeper.java | 1 + 1 file changed, 1 insertion(+) diff --git a/hbase-zookeeper/src/main/java/org/apache/hadoop/hbase/zookeeper/RecoverableZooKeeper.java b/hbase-zookeeper/src/main/java/org/apache/hadoop/hbase/zookeeper/RecoverableZooKeeper.java index 9cc1ab21bde..b9d764bc51b 100644 --- a/hbase-zookeeper/src/main/java/org/apache/hadoop/hbase/zookeeper/RecoverableZooKeeper.java +++ b/hbase-zookeeper/src/main/java/org/apache/hadoop/hbase/zookeeper/RecoverableZooKeeper.java @@ -135,6 +135,7 @@ public class RecoverableZooKeeper { if (this.zk == null) { try { this.zk = new ZooKeeper(quorumServers, sessionTimeout, watcher); + ZooKeeperHelper.ensureConnectedZooKeeper(this.zk, 30000); } catch (IOException ex) { LOG.warn("Unable to create ZooKeeper Connection", ex); throw new KeeperException.OperationTimeoutException();