From 810c179592cedc5466d714fe0d54a221e69a762e Mon Sep 17 00:00:00 2001 From: Danyal Prout <672580+danyalprout@users.noreply.github.com> Date: Wed, 18 Mar 2020 06:04:09 -0400 Subject: [PATCH] Kazoo 2.7.0 Compatibility Close https://github.com/zalando/patroni/issues/1448 --- patroni/dcs/zookeeper.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/patroni/dcs/zookeeper.py b/patroni/dcs/zookeeper.py index 33433d7a..8e9f5637 100644 --- a/patroni/dcs/zookeeper.py +++ b/patroni/dcs/zookeeper.py @@ -76,7 +76,7 @@ class ZooKeeper(AbstractDCS): self._client.start() - def _kazoo_connect(self, host, port): + def _kazoo_connect(self, *args): """Kazoo is using Ping's to determine health of connection to zookeeper. If there is no response on Ping after Ping interval (1/2 from read_timeout) it will consider current connection dead and try to connect to another node. Without this "magic" it was taking @@ -88,7 +88,7 @@ class ZooKeeper(AbstractDCS): than loop_wait, because we can spend up to 2 seconds when calling `touch_member()` and `write_leader_optime()` methods, which also may hang...""" - ret = self._orig_kazoo_connect(host, port) + ret = self._orig_kazoo_connect(*args) return max(self.loop_wait - 2, 2)*1000, ret[1] def session_listener(self, state):