From e57cdf9a7b2cc916108a40670d133c209d31b776 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Thu, 27 Sep 2018 15:14:45 -0400 Subject: [PATCH] Add more collective event log handling More detail to analyze how the collective membership is handled. --- confluent_server/confluent/collective/manager.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/confluent_server/confluent/collective/manager.py b/confluent_server/confluent/collective/manager.py index d4a4cdbf..dcb11717 100644 --- a/confluent_server/confluent/collective/manager.py +++ b/confluent_server/confluent/collective/manager.py @@ -60,6 +60,7 @@ def connect_to_leader(cert=None, name=None, leader=None): cfginitlock = threading.RLock() if leader is None: leader = currentleader + log.log({'info': 'Attempting connection to leader {0}'.format(leader)}) try: remote = connect_to_collective(cert, leader) except socket.error as e: @@ -104,7 +105,6 @@ def connect_to_leader(cert=None, name=None, leader=None): return become_leader(remote) print(keydata['error']) return False - if follower is not None: follower.kill() cfm.stop_following() follower = None @@ -485,6 +485,7 @@ def retire_as_leader(): def become_leader(connection): global currentleader global follower + log.log({'info': 'Becoming leader of collective'}) if follower: follower.kill() follower = None