Files
podman/pkg/systemd/notifyproxy
Tobias Wiesing 2132e0918b pkg/systemd/notifyproxy: wait for a barrier before exiting
systemd attributes a notification to a unit by the cgroup of its sender
when it reads the message. The podman process that sends READY for
--sdnotify=healthy exits right after sending it, and when systemd reads
the message only then, it is dropped and the unit runs into its start
timeout.

Add SendMessageWithBarrier, which sends BARRIER=1 with a pipe fd after
the message and waits up to five seconds until the receiver closes it,
as sd_notify_barrier(3) does. Use it where podman may exit after
notifying: MAINPID (and READY) after starting a container, READY once it
is healthy, and the fast path of kube play. A failed barrier is only
logged at debug level since the message itself was sent.

Also parse only the received control message in the proxy's listener.
It parsed the whole buffer, failed, and never closed the barrier fds.

The sdnotify system tests now receive on the notify socket with a new
podman-testing sd-notify-listen command instead of socat. socat keeps
the fds it receives, so every barrier ran into its timeout; the new
command closes them right away. BARRIER=1 is not logged.

Fixes: #29998
Signed-off-by: Tobias Wiesing <tobias@hueske.digital>
2026-10-21 15:29:10 +02:00
..