[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
@@ -308,12 +308,8 @@ def test_ray_dp_addresses_resolved_before_actor_creation(
executor_class=_DummyExecutor,
log_stats=False,
addresses=addresses,
) as (
engine_manager,
_coordinator,
_addresses_out,
_tensor_queue,
):
) as engine_launch:
engine_manager = engine_launch.engine_manager
assert isinstance(engine_manager, CoreEngineActorManager)
# API-server children bind to the pre-allocated ports.
@@ -0,0 +1,68 @@
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
from multiprocessing import connection
from types import SimpleNamespace
import pytest
import zmq
from vllm.v1.engine.utils import (
CoreEngine,
CoreEngineLaunch,
EngineZmqAddresses,
wait_for_engine_startup,
)
pytestmark = pytest.mark.skip_global_cleanup
class _FinishedProcess:
name = "RustFrontend"
def __init__(self, sentinel):
self.sentinel = sentinel
@property
def exitcode(self):
return 1
def test_wait_for_engine_startup_reports_watched_process_exit():
ctx = zmq.Context()
handshake_socket = ctx.socket(zmq.ROUTER)
recv, send = connection.Pipe(duplex=False)
send.close()
parallel_config = SimpleNamespace(
data_parallel_size_local=1,
data_parallel_hybrid_lb=False,
data_parallel_external_lb=False,
)
try:
launch = CoreEngineLaunch(
engine_manager=None,
coordinator=None,
addresses=EngineZmqAddresses(inputs=[], outputs=[]),
tensor_queue=None,
)
launch.watched_frontend_processes = [_FinishedProcess(recv)]
with pytest.raises(RuntimeError) as exc_info:
wait_for_engine_startup(
handshake_socket,
[CoreEngine()],
parallel_config, # type: ignore[arg-type]
coordinated_dp=False,
cache_config=None, # type: ignore[arg-type]
launch=launch,
)
finally:
recv.close()
handshake_socket.close(linger=0)
ctx.term()
assert "Frontend process failed during engine core initialization" in str(
exc_info.value
)
assert "Failed frontend proc(s): {'RustFrontend': 1}" in str(exc_info.value)