2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-25 19:10:10 +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 326f56219b
commit b0b5493ff7

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()