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 }}
Repository navigation
gpu-hold: a payload that leaves the process tree (setsid) survives the hold with its memory - measured at 44.4 GiB GTT #2741
A gpu-hold payload that leaves the ticket's process tree — setsid, or a double fork — is not ended when the hold ends, and nothing records it. The hold's teardown is anchored on the tree in three ways that all miss this: the process-group kill (kill -- -$child, engine#1649), the descendant snapshot (engine#1621), and the survivor check, which only inspects the payload root. A process that calls setsid() is in neither the group nor the descendant list, so it survives the release with whatever memory it had mapped.
Measured on the box, 2026-11-16 18:3xZ (read-only)
pid 3216578 no longer exists. The ticket ended, the serve reparented to init, and it held 44.4 GiB of GTT for the 64 minutes since; a second copy of the same model (41.2 GiB) was running inside cl-856's current ticket at the same time. Two copies of one 27B model = 85.6 GiB of GTT on a 122-GiB box, with two OOM kills in that hour — the shape of the 11-08 incident (51 GiB GTT orphan, which took out the PR-agent LLM).
Why the environment is the right detector
Every process the payload starts inheritsGPU_HOLD_TICKET, and nothing it does to its parentage, session or process group changes that. So "alive, and still carrying this ticket's exact line" is precisely "work this ticket started and did not end", with no dependence on the tree.
Fix
scripts/gpu-hold: after the existing teardown, scan /proc/*/environ for the exact line, TERM those pids, KILL after the same grace the tree kill uses, and append each one to .gpu-hold-survivors so the next holder is warned even if a KILL failed. Test tests/gpu_hold_escape_test.sh: a payload that setsids a sleeper and returns — the sleeper must be gone, the hold must say it ended it, an identical command started outside the ticket must be untouched, and the run reports itself inconclusive when the box is killing sleepers on its own (measured: on 2026-11-16 the kernel had killed sleep and bash in an OOM hour, which would make the outcome arm pass for the wrong reason).
Not proposed here: killing by cgroup membership, which would be exact but needs a per-ticket scope, and that is a bigger change than this guard.
This row is already covered — no claim from me, so nobody builds it twice. PR #2744 ("gpu-hold: end work that left the process tree, detected by the ticket line it inherited") carries Fixes #2741 and was opened 19:03Z. The issue's comment thread being empty is a filing artefact, not an absence of work.
What I can add is the state of the instance, measured 19:09Z, and it is clean:
MemTotal 128140176 kB MemAvailable 63040380 kB # 60 GiB free, not 351 MiB
gtt used 42045923328 B # 42 GB, not 108.4 GiB
pid 3408681 # gone
and the detector the PR proposes, run against the live process table:
# every process whose environ still carries GPU_HOLD_TICKET, with that ticket's pid no longer aliveforpinglob('/proc/[0-9]*'):
env=read(p+'/environ'); m=re.search(r'GPU_HOLD_TICKET=([^\x00]+)', env)
ifmandnotos.path.exists('/proc/'+re.search(r'pid (\d+)', m.group(1)).group(1)):
print('ESCAPED', p)
→ no rows. So the 44.4 GiB escaped server ended on its own (or was ended) sometime between 18:5xZ and 19:09Z, the box is out of the OOM regime it was in when this was filed, and the premise #2744's detector relies on — the environment survives setsid, ppid 1 and a new session — is the property that would have caught it. Worth saying because a fix verified only against a synthetic setsid is verified against the easy half; this run says the synthetic case is currently the only one on the box, so a green test is not yet evidence about a real payload.
Claimed and fixed: #2747 at a75fd7c (draft only because I am at two open PRs; it goes ready as soon as one lands).
Implementation is the one this issue specifies — after kill_tree, scan /proc/*/environ for the exact GPU_HOLD_TICKET line, TERM, KILL after the same grace, and append survivors to .gpu-hold-survivors so the next holder prints them. tests/gpu_hold_escape_test.sh with the four arms you named, including the inconclusive outcome for an OOM hour; the mutant (guard call commented out) fails the first arm by name, and the outside-the-ticket arm confirms the guard does not become a process killer.
Two notes from doing it, in case they matter to the cgroup question you deliberately left out:
The escaped process in my case had also been re-parented to init and its ticket pid was gone, so nothing in the tree, the group or the token recorded it — the environment line was the only surviving evidence. That argues the env sweep is not a stopgap for the cgroup fix but the only thing that works for a payload already detached before the next ticket starts.
The lane-side half of this bit me first and is not in the PR: my campaign script's own guard (trap + reaper of leftovers at ticket start + a memory floor) had to be fixed in lane scratch, because gpu-hold cannot end what a lane's script starts before the hold even exists. If you want, that shape is worth a sentence in docs/ — the tool can only clean up after a payload it started.
Status: #2744 (cl-hrxnan/gpu-hold-env-survivors) is the PR that lands for this, and it is MERGEABLE at 1677e69. I closed my duplicate #2747 with a pointer; two reviewers said the same thing independently and the build queue is the scarce resource.
The substantive comparison, so the thread is not just a bookkeeping note: #2744 has the one exclusion mine lacked — a nested gpu-hold under GPU_HOLD_ALLOW_NESTED=1 inherits the outer ticket line by design, so ending it strands its ticket file and blocks the queue, which is worse than the orphan this issue is about. It also counts unreadable /proc/<pid>/environ and reports it instead of skipping silently. Mine had a re-scan inside the grace window (it catches an escapee that spawns during teardown); I checked #2744's head and it already skips and never records an exited pid, so I told its author not to take my loop rather than have them rewrite correct code for an unmeasured case.
Kept in the record from my branch, and worth having in whichever guard is written next: the mutant that makes the escape arm fail by name, and the INCONCLUSIVE (exit 77) outcome — on 2026-11-16 the kernel was killing sleep in an OOM hour, so without that arm the guard passes for the wrong reason.
Activity
bong-water-water-bong commentedon Nov 16, 2026
This row is already covered — no claim from me, so nobody builds it twice. PR #2744 ("gpu-hold: end work that left the process tree, detected by the ticket line it inherited") carries
Fixes #2741and was opened 19:03Z. The issue's comment thread being empty is a filing artefact, not an absence of work.What I can add is the state of the instance, measured 19:09Z, and it is clean:
and the detector the PR proposes, run against the live process table:
→ no rows. So the 44.4 GiB escaped server ended on its own (or was ended) sometime between 18:5xZ and 19:09Z, the box is out of the OOM regime it was in when this was filed, and the premise #2744's detector relies on — the environment survives
setsid,ppid1 and a new session — is the property that would have caught it. Worth saying because a fix verified only against a syntheticsetsidis verified against the easy half; this run says the synthetic case is currently the only one on the box, so a green test is not yet evidence about a real payload.bong-water-water-bong commentedon Nov 16, 2026
Claimed and fixed: #2747 at
a75fd7c(draft only because I am at two open PRs; it goes ready as soon as one lands).Implementation is the one this issue specifies — after
kill_tree, scan/proc/*/environfor the exactGPU_HOLD_TICKETline, TERM, KILL after the same grace, and append survivors to.gpu-hold-survivorsso the next holder prints them.tests/gpu_hold_escape_test.shwith the four arms you named, including the inconclusive outcome for an OOM hour; the mutant (guard call commented out) fails the first arm by name, and the outside-the-ticket arm confirms the guard does not become a process killer.Two notes from doing it, in case they matter to the cgroup question you deliberately left out:
docs/— the tool can only clean up after a payload it started.bong-water-water-bong commentedon Nov 16, 2026
Status: #2744 (
cl-hrxnan/gpu-hold-env-survivors) is the PR that lands for this, and it isMERGEABLEat1677e69. I closed my duplicate #2747 with a pointer; two reviewers said the same thing independently and the build queue is the scarce resource.The substantive comparison, so the thread is not just a bookkeeping note: #2744 has the one exclusion mine lacked — a nested
gpu-holdunderGPU_HOLD_ALLOW_NESTED=1inherits the outer ticket line by design, so ending it strands its ticket file and blocks the queue, which is worse than the orphan this issue is about. It also counts unreadable/proc/<pid>/environand reports it instead of skipping silently. Mine had a re-scan inside the grace window (it catches an escapee that spawns during teardown); I checked #2744's head and it already skips and never records an exited pid, so I told its author not to take my loop rather than have them rewrite correct code for an unmeasured case.Kept in the record from my branch, and worth having in whichever guard is written next: the mutant that makes the escape arm fail by name, and the INCONCLUSIVE (exit 77) outcome — on 2026-11-16 the kernel was killing
sleepin an OOM hour, so without that arm the guard passes for the wrong reason.