Skip to content

diagnostics: ignore zombies when waiting for the process group - #645

Merged
ankitjoju-google merged 1 commit into
GoogleCloudPlatform:masterfrom
ankitjoju-google:fix-diagnostics-zombie-wait
Nov 10, 2026
Merged

ankitjoju-google merged 1 commit into
GoogleCloudPlatform:masterfrom
ankitjoju-google:fix-diagnostics-zombie-wait

Conversation

@ankitjoju-google

Copy link
Copy Markdown
Collaborator

After a collection times out, the collector SIGKILLs the script's process group and waits for it to exit. groupAlive only checked kill(-pgid, 0), which still succeeds while zombie members remain. Without a reaping init (a container whose PID 1 never waits, e.g. Prow's test pod), the killed children never get reaped, so every timed-out run waited the full 5s and set busy.

groupAlive now also scans /proc/<pid>/stat and treats a group whose only members are zombies as gone (it still reports alive if /proc can't be read).

GKE nodes aren't affected today because the device plugin pod runs with hostPID, so the host reaps orphans.

Testing:

  • go test ./pkg/gpu/nvidia/diagnostics/
  • TestCollectorTimeoutKillsProcessGroup with the test binary as a non-reaping PID 1 (unshare -Urpf --mount-proc): 5.5s and failing before, 0.5s and passing after.

After a timeout kill, groupAlive polled kill(-pgid, 0) for up to 5s.
Without a reaping init (a container whose PID 1 never waits), the killed
children stay zombies and still count as group members, so every timed-out
collection waited the full 5s and marked the executor busy.

Treat a group whose only members are zombies as gone.
@ankitjoju-google ankitjoju-google self-assigned this Nov 10, 2026
@ankitjoju-google
ankitjoju-google merged commit 285eaee into GoogleCloudPlatform:master Nov 10, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants