mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #4574] [Other] managed runtime host husks forever after its server child exits — no child watcher, no reap, no self-heal; profile stays locked until manual kill (0.1.49.2, verified present in 0.1.51) #2067
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#2067
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @l473n79c618e on GitHub (Oct 29, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/4574
Area
Terminal — managed runtime host (
strata runtime start, strata-control).Desktop app, Terminal or source?
Terminal (managed runtime host on POSIX).
What happened
A managed runtime host supervises its server child not at all. If the child exits for any reason — clean or not — the host process keeps running as a husk: it stays in its accept loop, keeps the state lock and the control socket, and the profile is unusable until a human kills the host PID.
Code path (strata-control 0.1.49.2,
strata_control/runtime.py):Host.serve()is an accept loop with a 1 s timeout. There is nojoin(), nowaitpid(), noSIGCHLDhandling, no poll ofself._childanywhere in the host loop._status()correctly reports the child asfailed(it polls), but nothing consumes that: no restart, no exit, no log line on child death.--shutdown-timeoutonly bounds_stop_child()on deliberate stop/restart paths; it never applies to an unexpected child death.Verified still present in strata-control 0.1.51 (code read 2026-10-28):
serve()accept loop never polls the child; reap happens only in thefinally/signal paths.Impact: any local client (agent harness, benchmark, GUI) sees a wedged runtime with a live-looking lock and no self-heal; recovery requires knowing to kill a PID that
statusdoes not point at as the problem.Smallest steps or command that reproduce it
strata runtime start <profile>; note the host PID and the server child PID (strata runtime status).kill <server-child-pid>(any signal; also observed with the child exiting cleanly on its own).strata runtime statusreportsfailed, everystrata runtime start/launchfor the profile refuses with "this profile already has a live managed runtime" (exit 6), and the HTTP port stays dead. The husk never exits on its own; onlykill <host-pid>+strata runtime startrecovers.Expected: the host should watch its child — on child exit, log it and either restart (bounded, like the engine auto-restart in
serve, issue #27) or tear down cleanly (close owner pipe, release state lock, exit non-zero) so the nextruntime startrecovers without manual kill.Reproduction status
Observed in the field (one real occurrence, 2026-10-27 ~11:02 local; not a controlled re-run). The code path was additionally confirmed by reading 0.1.49.2 and 0.1.51. A controlled
kill <child>repro would confirm the full matrix but was not run.Strata version
Bundle 0.1.49.2 (linux-x86_64, python 3.12.15); strata-control 0.1.49.2, code re-read at 0.1.51.
Graphics card, memory and system
Arch Linux x86_64, single GPU with 24 GiB VRAM, 64 GiB DRAM.
Model, size and settings
Profile
launch-iq3_s-128k(IQ3_S quantization, 128k context), single profile.Logs
Watchdog blocks from the 2026-10-27 incident recorded:
strata runtime status= childfailedwhile the host PID stayed alive, and repeatedstrata runtime startattempts returning exit 6 ("this profile already has a live managed runtime"). The in-flight generation was severed at the transport level when the child exited. Recovery waskill <host-pid>+runtime start. Sanitized excerpt available on request.@github-actions[bot] commented on GitHub (Oct 29, 2026):
Thanks for the issue. To keep the tracker readable, every item needs an area prefix in the title and the parts of the issue form filled in. This one is missing:
Edit the issue (title and description) and this note goes away on its own. If it is still missing parts in 5 days it will be closed, which is not a rejection: fix it and comment
/reopen.Details: CONTRIBUTING.md
@github-actions[bot] commented on GitHub (Oct 29, 2026):
Thanks, this follows the format now.
@l473n79c618e commented on GitHub (Oct 30, 2026):
Additional data point. Two husk events in a single boot session (2026-10-29 to 30).
Hardware: RTX 3090 24GB, 64GB DDR5 CL26, Ryzen 7 7800X3D, CachyOS, kernel 7.3.0-5-cachyos.
Strata: engine 0.1.50, control 0.1.51, app 0.2.6. Model: Qwen3.8-Flash-Next IQ3_S GGUF, 128K context.
Profile: tune field set to null (removed from launch preset). tuned_preset still pinned.
Husk 1 (Oct 27, 11:02): tune-reload triggered cancel=True, child exited, host wedged in join().
Husk 2 (Oct 30, post-reboot): No tune-reload. Process found wedged (1050 MiB VRAM, no model, curl empty, thread count 1). Child had died at unknown time between boot and discovery. No "stopping" line preceding the death. No cancel=True. The child simply stopped and the host did not reap it.
This confirms the husk is not exclusively a tune-reload artifact. The serve() accept loop never polls the child process. A child death from any cause produces the same wedged host. The fix is the reap, not the trigger elimination.
Recovery: kill host PID, runtime start. 2-3 min cold reload. No data loss.
@XiaoBinGan commented on GitHub (Nov 1, 2026):
Reproduced on Windows 11 / Python 3.11.16 without a GPU, with the fake engine of
tests/terminal/test_runtime.py:runtime.start("local", wait=10, shutdown_timeout=2)-> ready; notehost_pid,child_pid.os.kill(child_pid, signal.SIGTERM)(the host did not ask for it).runtime.status("local")is{"state": "failed", "error": "server_exited"}, and the private state file is still there. A second start in that state is refused with "this profile already has a live managed runtime".Fix intent: the host watches
self.childin its accept loop. An exit the host did not ask for (not a stop, a restart or the failed-probe stop, which stay as they are) is followed by a 2 s grace so a client that is waiting for the failure can still readfailedand the log tail; then the host leaves through the cleanup it already has (private state file, ready file, child marker, activity lease), so the next start recovers without a manual kill. A test intests/terminal/test_runtime.pyfails onmainand passes with the change. The launch-side handling of a host it finds (#4824) is a separate change and is not claimed here.@XiaoBinGan commented on GitHub (Nov 1, 2026):
The fix and its regression test are in #4893: https://github.com/Niko1221/Strata/pull/4893
@Niko1221 commented on GitHub (Nov 5, 2026):
Hello l473n79c618e,
Thank you for the full report and the version history. In Strata 0.2.11 the runtime owner watches its server: when the server ends on its own, status says
failedwith the log tail for about 10 seconds, then the owner leaves, releasing its state and lease, and a plan failure does the same. It writes a line inhost.log. In our test akill -9of the server removed host and engine in 11 seconds and the next launch worked. If a host still stays behind on 0.2.11, please sendhost.logand the process list.The Strata project