Make different kazoo timeouts depend on loop_wait (#243)

* Make different kazoo timeouts dependant on loop_wait

ping timeout ~ 1/2 * loop_wait
connect_timeout ~ 1/2 * loop_wait

Originally these values were calculated from negotiated session timeout
and didn't worked very well, because it was taking significant time to
figure out that connection is dead and reconnect (up to session timeout)
and not giving us time to retry.

* Address the code review
This commit is contained in:
Alexander Kukushkin
2016-08-10 10:15:09 +02:00
committed by GitHub
parent a47a2bceff
commit 5fe74bec3b
9 changed files with 153 additions and 79 deletions
+1 -1
View File
@@ -74,7 +74,7 @@ class TestPatroni(unittest.TestCase):
def test_schedule_next_run(self):
self.p.ha.dcs.watch = Mock(return_value=True)
self.p.schedule_next_run()
self.p.next_run = time.time() - self.p.nap_time - 1
self.p.next_run = time.time() - self.p.dcs.loop_wait - 1
self.p.schedule_next_run()
def test_noloadbalance(self):