2
0
mirror of https://github.com/xcat2/confluent.git synced 2026-10-20 14:45:45 +00:00

Avoid spawning redundant macmap workers

This commit is contained in:
Jarrod Johnson
2026-08-19 13:43:29 -04:00
parent 42fd63763e
commit 3463bd24c1
@@ -219,9 +219,14 @@ def _fast_backend_fixup(macs, switch):
else:
_nodesbymac[mac] = (nodename, nummacs)
startuplock = None
async def _offload_map_switch(switch, password, user, privprotocol=None):
if _offloader is None:
await _start_offloader()
global startuplock
if startuplock is None:
startuplock = asyncio.Lock()
async with startuplock:
await _start_offloader()
evtid = random.randint(0, 4294967295)
while evtid in _offloadevts:
evtid = random.randint(0, 4294967295)
@@ -240,7 +245,6 @@ async def _offload_map_switch(switch, password, user, privprotocol=None):
return result
async def _start_offloader():
global _offloader
#_offloader = subprocess.Popen(