You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Catch leftover processes automatically (heavy cleans up its scope, a leftover sweep, capacity check names them) #159
Problem (owner, 2026-11-15): leftover processes must be caught automatically, not found by hand when the machine is already overloaded.
What happened: test helpers from one test file (a background job loop) kept spinning after their test runs ended: 73 of them, about 3 CPU cores, for hours. Earlier, test-harness runs of another tool lived 9 to 85 hours. Nothing noticed until the load reached about 13x the core count and agents stalled.
Root cause: the heavy wrapper (runs builds and tests in a capped systemd user slice) uses systemd-run --scope. A scope lives as long as any process in it, so when the test command ends, everything it left behind keeps running inside the slice, with no report. Processes started outside heavy have no owner check at all.
Fix, in layers (enforced, not trusted):
heavy cleans up after itself. When the command ends (or is stopped), it stops its own scope, so every leftover dies with it, and prints heavy: stopped N leftover processes (<names>) on stderr so the leak is seen and fixed at its source. An explicit opt-out for commands that must leave a daemon (named, logged). Source in a repository with tests (it has none today), installed like the other host tools.
Leftover sweep for everything else. A small user timer finds processes whose owner is gone (reparented to the user manager, not a known service, older than a few minutes) and either busy or long-lived. Test-shaped ones are stopped; others are reported. Every action goes to a log and a short report.
The capacity check says why.t3-capacity names leftover processes and their CPU when it says NOT OK, so agents and the orchestrator see the cause at once.
Tests prove it. Each layer has a test that fails without it (a command that leaves a spinning child; an orphan older than the limit).
General vs project: the wrapper, sweep and checks are general (any Linux host with systemd user slices); slice name, limits, sweep patterns and age come from a config file. Project parts (which test patterns count, where reports go) are a thin adapter.
Related: host tools without a source in a repository; finished agents keep their process; a test-harness leak in the project repo.
Found on 2026-11-15 while agents were waiting for memory: 11 leftover test database containers (MariaDB, up to 3 days old, made by database tests whose process had died) held about 1.2 GB of swap, plus one orphaned test harness that polled for a file every 0.05 s for over 2 hours after its CI job ended. Removing them by hand freed the swap.
Root-cause note for this issue: containers run under the Docker daemon, outside the heavy cgroup, so killing the test's process tree never removes them. The cleanup needs to cover them too, for example: tests label their containers with an owner (heavy run id or pid), and the sweep removes labelled containers whose owner is gone. Unlabelled containers should be reported, not removed.
Activity
scuttletoby commentedon Nov 15, 2026
Found on 2026-11-15 while agents were waiting for memory: 11 leftover test database containers (MariaDB, up to 3 days old, made by database tests whose process had died) held about 1.2 GB of swap, plus one orphaned test harness that polled for a file every 0.05 s for over 2 hours after its CI job ended. Removing them by hand freed the swap.
Root-cause note for this issue: containers run under the Docker daemon, outside the
heavycgroup, so killing the test's process tree never removes them. The cleanup needs to cover them too, for example: tests label their containers with an owner (heavy run id or pid), and the sweep removes labelled containers whose owner is gone. Unlabelled containers should be reported, not removed.🤖 Generated with Claude Code
fork-kit: heavy stops what its command leaves behind (#173)
fork-kit: heavy sweep finds what escaped heavy; common machine-file l…
fork-kit: heavy sweep finds what escaped heavy; common machine-file l…
fork-kit: heavy stops what its command leaves behind (#173)
fork-kit: heavy sweep finds what escaped heavy; common machine-file l…
fork-kit: heavy stops what its command leaves behind (#173)
fork-kit: heavy sweep finds what escaped heavy; common machine-file l…
fork-kit: heavy stops what its command leaves behind (#173)
fork-kit: heavy sweep finds what escaped heavy; common machine-file l…
heavy: clean up everything a command started; heavy leftovers names t…
heavy: clean up everything a command started; heavy leftovers names t…
heavy: clean up everything a command started; heavy leftovers names t…
fork-kit: heavy stops what its command leaves behind (#173)
fork-kit: heavy sweep finds what escaped heavy; common machine-file l…
heavy: clean up everything a command started; heavy leftovers names t…
fork-kit: heavy stops what its command leaves behind (#173)
fork-kit: heavy sweep finds what escaped heavy; common machine-file l…
heavy: clean up everything a command started; heavy leftovers names t…
feat(server): Antigravity limits from the CLI's own /usage report (#1149
fork-precheck --push: the cheap fork checks before every push, checks…
heavy-install: t3-capacity link survives a rollback; uninstall restor…
fork-kit tests: turn off git auto maintenance in temp repos (#1186)
heavy facts: holds for user-manager slices, reserveDirs for closed ho…