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
Commit c4af2ff
Browse filesBrowse the repository at this point in the historyBrowse files
fix(launcher): repeat the group SIGKILL until reaped so a missed member cannot hold Done open (#1652)
Closes#1649
## Root cause
`TestRetire_LauncherKillReachesDescendants` failure is a real (rare)
production slow path, not only a tight test window. A SIGKILL to the
launcher's process group can miss a group member that is being forked at
that instant (reproduced locally under CPU load: a `sleep 30` orphan
survived the group kill, ppid 1, same pgid). That member inherits the
launcher's stdout/stderr, so `reap()` blocks in `pumpWG.Wait()` and then
in `awaitGroupEmpty` (the exited leader is deliberately kept unreaped
while a group member runs). Done stayed open until the member exited: 30
s here, forever for a daemon. The test's `treeAlive` cannot see it
(`sleep 30` has no dir in its command line), so only the Done wait
failed.
## Fix
- `handle.killed` is set when a SIGKILL is sent (Kill, Stop escalation,
retirement).
- `repeatKillUntilReaped` (started before the pump drain, stopped after
the reap) re-sends SIGKILL every 50 ms under `reapMu` only while the
leader is unreaped, so the zombie/live leader still pins the pgid (no
reuse risk). No-op on Windows (Job Object).
- Test: `TestHandle_KillMissedMember_RepeatedUntilGroupEmpty` (fails
without the fix); the core test's Done wait widened to 15 s.
## Verification
race tests ./internal/upstream/... bare and -tags server, GOOS=windows
vet, golangci-lint (only pre-existing govet inline in
client_secret_test.go), 40x TestRetire_ under 30 CPU spinners.
Cross-reviewed with opencode Sol 6.1: round 1 ISSUES (retry must start
before pump drain; fixed), round 2 CLEAN.
0 commit comments