2
0
mirror of https://github.com/xcat2/confluent.git synced 2025-03-29 03:27:24 +00:00

Fix try_assimilate

Also get rid of CLOSE_WAIT in some situations.
This commit is contained in:
Jarrod Johnson 2018-06-28 09:53:34 -04:00
parent 97f932b946
commit 93e78d1f03
2 changed files with 4 additions and 0 deletions

View File

@ -96,6 +96,7 @@ def connect_to_leader(cert=None, name=None, leader=None):
def follow_leader(remote):
cfm.follow_channel(remote)
# The leader has folded, time to startup again...
remote.close()
eventlet.spawn_n(start_collective)
@ -272,6 +273,8 @@ def try_assimilate(drone):
tlvdata.send(remote, {'collective': {'operation': 'assimilate',
'name': get_myname(),
'txcount': cfm._txcount}})
tlvdata.recv(remote) # the banner
tlvdata.recv(remote) # authpassed... 0..
answer = tlvdata.recv(remote)
if 'error' in answer:
connect_to_leader(None, None, leader=remote.getpeername()[0])

View File

@ -475,6 +475,7 @@ def relay_slaved_requests(name, listener):
if 'xid' in rpc:
_push_rpc(listener, cPickle.dumps({'xid': rpc['xid']}))
msg = listener.recv(8)
listener.close()
del cfgstreams[name]
if not cfgstreams:
cfgleader = True