Files
magpie/internal/proc
yetone 382c8c0bdf proc: magpie serve reaps the processes it adopts (Kling__Lab on X)
254 <defunct> children of `magpie serve` after 7 days, growing ~9 an hour
(magpie, uv, node, npm, magpie-bun, code-review-graph), only a restart
cleared them. Every command magpie starts is waited for (the AST guard
TestEveryStartedCommandIsWaited holds, and I read each Start site and
Output/StartTree/StartReaped by hand: none is missed). The zombies are the
grandchildren: an agent CLI's MCP servers whose parent ended are adopted by
magpie where it is PID 1 (a container) or a child subreaper, and nothing
waits for a process it never started.

proc.KeepReaping (Linux, from serve) does nothing unless magpie adopts
(PID 1 or PR_GET_CHILD_SUBREAPER), and then reaps a child of its own that
was a zombie at two looks 5s apart. Not tried: the reporter's container;
the cause (PID 1 / subreaper) is inferred from the report, not seen.

Run: TestAdoptedOrphansAreReaped (subreaper test process, 6 orphans) and
the proc package through wsl-run on magpie-desktop: ok. Broken by hand
(KeepReaping returning at once): 6 adopted zombies left, red.
2026-11-13 10:29:07 +08:00
..