Found by adversarial review round 3 of PR #109. Severity P2; same behaviour as main before the PR (nothing killed background children then either), so not a regression, but ADR 0011 now claims the group is the unit of cleanup.
Probe: sleep 600 </dev/null >/dev/null 2>&1 & echo $! > pidfile; exit. The shell exits, reap() clears the container's PGID, Close returns, and the sleep keeps running with PGID == the old shell PID. It never called setsid/setpgid, so it is not in the documented escape list.
Suggested fix: distinguish "group leader exited" from "group cleaned up"; on Close after a natural exit, kill the group once before dropping the identity (needs the reap-window fix from the sibling issue so the kill cannot hit a reused PGID).
Found by adversarial review round 3 of PR #109. Severity P2; same behaviour as main before the PR (nothing killed background children then either), so not a regression, but ADR 0011 now claims the group is the unit of cleanup.
Probe:
sleep 600 </dev/null >/dev/null 2>&1 & echo $! > pidfile; exit. The shell exits,reap()clears the container's PGID,Closereturns, and the sleep keeps running with PGID == the old shell PID. It never called setsid/setpgid, so it is not in the documented escape list.Suggested fix: distinguish "group leader exited" from "group cleaned up"; on Close after a natural exit, kill the group once before dropping the identity (needs the reap-window fix from the sibling issue so the kill cannot hit a reused PGID).