Skip to content

nvidia-operator-validator container ignores SIGTERM (sh sleep loop as PID 1), delaying node shutdown by 90s #3293

Not planned

Description

@mirinus

Summary

The main container of the nvidia-operator-validator pod runs a sh loop as PID 1 that never exits on SIGTERM. On a node reboot (k3s, no drain), systemd waits for its default stop timeout (90 s) on that container's scope and then kills it. Every reboot of the node is delayed by ~90 s because of this one container.

Environment

  • GPU Operator: v26.7.3 (Helm chart gpu-operator-v26.7.3), installed with driver.enabled=false, toolkit.enabled=false, and a time-slicing config for the device plugin (driver and container toolkit are installed on the host)
  • Kubernetes: k3s v1.34.4+k3s1 (embedded containerd), agent (worker) node
  • OS: Ubuntu 24.04.5 LTS, aarch64 (NVIDIA GB10), kernel 6.17.0-1032-nvidia, systemd 255

What I observed

The nvidia-operator-validator container in the pod runs:

sh -c "echo all validations are successful; while true; do sleep 86400; done"

as the container's PID 1 (sh, with a sleep child). A shell running as PID 1 in a container does not terminate on SIGTERM unless a handler is installed.

When the node is rebooted with systemctl reboot (no kubectl drain), k3s' KillMode=process leaves the containers alive until system shutdown, and systemd then stops each cri-containerd-<id>.scope. For this container the journal shows nothing for ~87 s, and then:

cri-containerd-<id>.scope: Stopping timed out. Killing.
cri-containerd-<id>.scope: Killing process <pid> (sh) with signal SIGKILL.
cri-containerd-<id>.scope: Killing process <pid> (sleep) with signal SIGKILL.
cri-containerd-<id>.scope: Failed with result 'timeout'.

Timeline (time from systemctl reboot to the end of the shutdown journal):

Reboot GPU Operator Shutdown
A installed 90 s (timeout above)
B installed 91 s (same timeout)
C helm uninstall + CRDs removed 3 s
D removed 3 s

The node answered ping for the whole ~90 s, so it was still running and waiting.

For completeness: in one earlier reboot with the operator installed, shutdown finished in 3 s without this timeout (that reboot had a separate ~111 s gap after the journal stopped, which I could not explain and cannot attribute to the operator).

Before the node joined the cluster as a k3s agent, the same machine always shut down in ~3 s.

Expected behavior

The validator's "wait" container exits promptly on SIGTERM, so that node shutdown is not delayed.

Possible fixes

  • Run the loop so that SIGTERM is handled, e.g. trap 'exit 0' TERM; while true; do sleep 86400 & wait $!; done, or run a small binary / tini-style init as PID 1.
  • If a newer validator already handles this (I saw an indication of a --sleep mode that blocks until SIGTERM, but could not confirm which release has it), please point me to it.

Notes

  • I did not test normal pod deletion (kubectl delete pod), where I would expect the delay to be bounded by terminationGracePeriodSeconds. The problem described here is the node shutdown path, where kubelet graceful shutdown is not enabled and systemd stops the container scopes.
  • Workarounds: drain the node before reboot, run k3s-killall.sh first, or lower DefaultTimeoutStopSec.

Activity

  1. added
    needs-triage
    on Nov 29, 2026
  2. mirinus commented on Nov 29, 2026

    @mirinus
    Author

    Closing this: I found a workaround through the existing validator.args Helm value, which TransformValidatorShared() applies to the validator's main container.

    validator:
      args:
        - "trap 'exit 0' TERM INT; echo all validations are successful; while true; do sleep 86400 & wait $!; done"

    I verified the command itself on the node with a test pod that uses the gpu-operator:v26.7.3 image (busybox sh) and stopped the container's systemd scope, which is what happens on node shutdown:

    Command systemctl stop cri-containerd-<id>.scope
    default (while true; do sleep 86400; done) 90.1 s, then Stopping timed out. Killing
    with trap 'exit 0' TERM INT and sleep & wait $! 0.009 s

    I did not run this through the operator-rendered DaemonSet end to end (I had already uninstalled the operator), so I can't confirm the Helm value path itself beyond reading the code.

    The default command still ignores SIGTERM, so other k3s/systemd-managed nodes may hit the same 90 s delay on reboot. Feel free to reopen if you want to change the default in assets/state-operator-validation/0500_daemonset.yaml (the DRA and sandbox validation manifests use the same loop).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions