2
0
mirror of https://github.com/xcat2/confluent.git synced 2025-01-16 04:39:16 +00:00

Cancel retry if we become leader

If an instance is first to start, it's retry should be canceled
when other members prod it to become leader.
This commit is contained in:
Jarrod Johnson 2018-10-01 15:29:18 -04:00
parent 484435c732
commit 9495a41f85

View File

@ -500,11 +500,15 @@ def retire_as_leader():
def become_leader(connection):
global currentleader
global follower
global retrythread
log.log({'info': 'Becoming leader of collective',
'subsystem': 'collective'})
if follower:
follower.kill()
follower = None
if retrythread:
retrythread.cancel()
retrythread = None
currentleader = connection.getsockname()[0]
skipaddr = connection.getpeername()[0]
myname = get_myname()