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:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user