Skip to content

Launch the sgl and miles routers as command-line subprocesses - #1976

Open
fzyzcjy wants to merge 1 commit into
tom/refactor-miles/op13-7from
tom/refactor-miles/op13-8
Open

Launch the sgl and miles routers as command-line subprocesses#1976
fzyzcjy wants to merge 1 commit into
tom/refactor-miles/op13-7from
tom/refactor-miles/op13-8

Conversation

@fzyzcjy

@fzyzcjy fzyzcjy commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

Part of #1837

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@fzyzcjy
fzyzcjy force-pushed the tom/refactor-miles/op13-8 branch from 3c25cae to d11009f Compare August 3, 2026 23:44
@fzyzcjy
fzyzcjy force-pushed the tom/refactor-miles/op13-7 branch from 5abc3cf to fa15e0c Compare August 4, 2026 00:39
@fzyzcjy
fzyzcjy force-pushed the tom/refactor-miles/op13-8 branch from d11009f to df98db5 Compare August 4, 2026 00:39
@fzyzcjy
fzyzcjy force-pushed the tom/refactor-miles/op13-7 branch from fa15e0c to c5747e3 Compare August 4, 2026 06:55
@fzyzcjy
fzyzcjy requested a review from Rockdu as a code owner August 4, 2026 06:55
@fzyzcjy
fzyzcjy force-pushed the tom/refactor-miles/op13-8 branch from df98db5 to cedb710 Compare August 4, 2026 06:55
@fzyzcjy
fzyzcjy force-pushed the tom/refactor-miles/op13-7 branch from c5747e3 to 0fef6c5 Compare August 4, 2026 07:27
@fzyzcjy
fzyzcjy force-pushed the tom/refactor-miles/op13-8 branch from cedb710 to a086f1e Compare August 4, 2026 07:28
@fzyzcjy
fzyzcjy force-pushed the tom/refactor-miles/op13-7 branch from 0fef6c5 to 0eb3ff3 Compare August 4, 2026 07:34
@fzyzcjy
fzyzcjy force-pushed the tom/refactor-miles/op13-8 branch 2 times, most recently from bc041ea to 56bd3e9 Compare August 6, 2026 03:48
@fzyzcjy
fzyzcjy force-pushed the tom/refactor-miles/op13-7 branch 2 times, most recently from 1770069 to 98b2b9e Compare August 6, 2026 07:03
@fzyzcjy
fzyzcjy force-pushed the tom/refactor-miles/op13-8 branch 2 times, most recently from 48c3201 to 30e5076 Compare August 9, 2026 23:33
@fzyzcjy
fzyzcjy force-pushed the tom/refactor-miles/op13-7 branch from 024fee0 to 302b81b Compare August 10, 2026 06:04
@fzyzcjy
fzyzcjy force-pushed the tom/refactor-miles/op13-8 branch from 30e5076 to 097764f Compare August 10, 2026 06:05
@fzyzcjy
fzyzcjy force-pushed the tom/refactor-miles/op13-7 branch from 302b81b to 7d7af58 Compare August 10, 2026 16:07
@fzyzcjy
fzyzcjy force-pushed the tom/refactor-miles/op13-8 branch from 097764f to 161fa0e Compare August 10, 2026 16:07
@fzyzcjy
fzyzcjy force-pushed the tom/refactor-miles/op13-7 branch from 7d7af58 to bd64922 Compare August 10, 2026 16:34
@fzyzcjy
fzyzcjy force-pushed the tom/refactor-miles/op13-8 branch 2 times, most recently from 12c94dc to ff6d55b Compare August 12, 2026 02:48
@fzyzcjy
fzyzcjy force-pushed the tom/refactor-miles/op13-7 branch from 25341b5 to ace9852 Compare August 12, 2026 14:31
@fzyzcjy
fzyzcjy force-pushed the tom/refactor-miles/op13-8 branch 2 times, most recently from 37755e2 to 5902f16 Compare August 12, 2026 14:36
@fzyzcjy
fzyzcjy force-pushed the tom/refactor-miles/op13-7 branch from ace9852 to 344b3a4 Compare August 12, 2026 14:36
@fzyzcjy
fzyzcjy force-pushed the tom/refactor-miles/op13-8 branch from 5902f16 to d882aa3 Compare August 12, 2026 23:56
@fzyzcjy
fzyzcjy force-pushed the tom/refactor-miles/op13-7 branch 2 times, most recently from d734533 to ce30961 Compare August 13, 2026 01:13
@fzyzcjy
fzyzcjy force-pushed the tom/refactor-miles/op13-8 branch from d882aa3 to b9f0287 Compare August 13, 2026 01:13
@fzyzcjy
fzyzcjy force-pushed the tom/refactor-miles/op13-7 branch from ce30961 to 7aa9b9b Compare August 13, 2026 03:25
@fzyzcjy
fzyzcjy force-pushed the tom/refactor-miles/op13-8 branch 2 times, most recently from 0526ff7 to 8015968 Compare August 13, 2026 06:00
@fzyzcjy
fzyzcjy force-pushed the tom/refactor-miles/op13-7 branch from 044fb9f to 566b99e Compare August 13, 2026 06:39
@fzyzcjy
fzyzcjy force-pushed the tom/refactor-miles/op13-8 branch 2 times, most recently from 4877c36 to f8ddffc Compare August 14, 2026 04:45
)
process.daemon = True
process.start()
process = process_utils.launch_bound_subprocess(launch_argv, envs={})

@guapisolo guapisolo Aug 26, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] On Linux, launch_bound_subprocess() passes a Python preexec_fn to Popen. This call runs after Ray/tracking have started threads, and CPython warns that preexec_fn can deadlock before exec; in that case Popen never returns, so the 30s readiness timeout never starts. Could we preserve PR_SET_PDEATHSIG via an exec-first trampoline (or equivalent) without running Python preexec_fn in the multithreaded parent? I traced this through #2176 and #2649; #1988 only moves the same helper call into a Ray CommandActor, so it remains unresolved.

start_router now renders a command line instead of spawning a
multiprocessing child: the sgl router runs its upstream CLI via a
RouterArgs-to-argv renderer that diffs against the CLI defaults and
roundtrip-asserts on every render, and the miles router gains a
__main__ entry fed by the config-json boundary. Both run under
launch_bound_subprocess so the parent-death semantics of the daemon
children are preserved, wait_for_server_ready learns to watch a Popen,
and the router spec's launch_command is rendered by the same functions
so the spec cannot drift from the launch path.
@fzyzcjy
fzyzcjy force-pushed the tom/refactor-miles/op13-8 branch from f8ddffc to 896d02f Compare August 29, 2026 12:38
@fzyzcjy
fzyzcjy force-pushed the tom/refactor-miles/op13-7 branch from 85040ca to 588422c Compare August 29, 2026 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants