[Frontend] Watch frontend processes during engine startup (#43417)

Signed-off-by: Bugen Zhao <i@bugenzhao.com>
Signed-off-by: Nick Hill <nickhill123@gmail.com>
Co-authored-by: OpenAI Codex <codex@openai.com>
Co-authored-by: Nick Hill <nickhill123@gmail.com>
This commit is contained in:
Bugen Zhao
2026-08-06 11:17:24 -07:00
committed by GitHub
co-authored by OpenAI Codex Nick Hill
parent 4f851bef6c
commit 7b9f2dad89
5 changed files with 152 additions and 42 deletions
+12 -7
View File
@@ -326,12 +326,12 @@ def run_multi_api_server(args: argparse.Namespace):
defer_api_server_ports=not (rust_frontend_path or is_ray_dp),
)
with launch_core_engines(vllm_config, executor_class, log_stats, addresses) as (
local_engine_manager,
coordinator,
addresses,
tensor_queue,
):
with launch_core_engines(
vllm_config, executor_class, log_stats, addresses
) as engine_launch:
local_engine_manager = engine_launch.engine_manager
coordinator = engine_launch.coordinator
addresses = engine_launch.addresses
stats_update_address = (
coordinator.get_stats_publish_address() if coordinator else None
)
@@ -364,7 +364,7 @@ def run_multi_api_server(args: argparse.Namespace):
input_addresses=addresses.inputs,
output_addresses=addresses.outputs,
stats_update_address=stats_update_address,
tensor_queue=tensor_queue,
tensor_queue=engine_launch.tensor_queue,
)
if not is_ray_dp:
@@ -377,6 +377,11 @@ def run_multi_api_server(args: argparse.Namespace):
addresses.inputs = actual_inputs
addresses.outputs = actual_outputs
# Set frontend processes to watch during engine startup.
# If any of these processes exit before the engines are up, the engine startup
# will be aborted with an error.
engine_launch.watched_frontend_processes = api_server_manager.processes
# Wait for API servers.
try:
wait_for_completion_or_failure(