[Bugfix] Release stage launch lock before handshake (#2717)

Signed-off-by: Chenguang ZHENG <645327136@qq.com>
This commit is contained in:
Chenguang Zheng authored and GitHub committed 2026-04-13 18:35:59 +08:00
1 parent cd2761e15c
commit 155583f49f
2 files changed
+101 -11

No files matched your search

+12 -11
View File
@@ -424,23 +424,24 @@ class AsyncOmniEngine:
proc=proc,
)
logger.info("[AsyncOmniEngine] Stage %s engine launch started", metadata.stage_id)
# Keep the stage-specific device visibility until vLLM
# finishes starting all child processes.
if self.single_stage_mode and self._omni_master_server is not None:
launch_stack.close()
else:
assert proc is not None
assert handshake_address is not None
complete_stage_handshake(
proc, handshake_address, addresses, vllm_config, stage_init_timeout
)
logger.info("[AsyncOmniEngine] Stage %s engine startup completed", metadata.stage_id)
finally:
if previous_visible_devices is None:
current_omni_platform.unset_device_control_env_var()
else:
current_omni_platform.set_device_control_env_var(previous_visible_devices)
# After StageEngineCoreProc has been spawned it carries its
# stage-specific device visibility into descendants, so the
# slow HELLO/READY handshake can run without holding the
# process-wide launch lock.
if self.single_stage_mode and self._omni_master_server is not None:
launch_stack.close()
else:
assert proc is not None
assert handshake_address is not None
complete_stage_handshake(proc, handshake_address, addresses, vllm_config, stage_init_timeout)
logger.info("[AsyncOmniEngine] Stage %s engine startup completed", metadata.stage_id)
assert started_stage is not None
return started_stage
except Exception: