2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-26 11:30:23 +00:00

Fix config sync on dead writer

The sync thread can die without clearing syncrunning.  Make sure that
the thread is alive *and* that the thread has not indicated
intent to give up.
This commit is contained in:
Jarrod Johnson 2018-10-10 13:07:27 -04:00
parent d5c093a30d
commit b77ed8dbff
2 changed files with 3 additions and 2 deletions

View File

@ -82,7 +82,7 @@ def connect_to_leader(cert=None, name=None, leader=None):
log.log({
'info': 'Collective initialization in progress on '
'{0}, will retry connection'.format(leader),
'subsystem': 'collective'})
'subsystem': 'collective'}) ####### bad idea?
eventlet.spawn_after(random.random(), connect_to_leader,
cert, name, leader)
return True

View File

@ -2061,7 +2061,8 @@ class ConfigManager(object):
if statelessmode:
return
with cls._syncstate:
if cls._syncrunning:
if (cls._syncrunning and cls._cfgwriter is not None and
cls._cfgwriter.isAlive()):
cls._writepending = True
return
cls._syncrunning = True