sigproxy: ignore if container already removed

If the container is already removed do not log a warning as this happens
in parallel so it is possible the container was already removed. The
flake was shown in https://github.com/containers/podman/pull/26017.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
Paul Holzinger
2025-04-30 17:59:00 +02:00
parent 9ce708774e
commit 8de2e0ec21

View File

@ -33,7 +33,8 @@ func ProxySignals(ctr *libpod.Container) {
}
if err := ctr.Kill(uint(syscallSignal)); err != nil {
if errors.Is(err, define.ErrCtrStateInvalid) {
// If the container is no longer running/removed do not log it as error.
if errors.Is(err, define.ErrCtrStateInvalid) || errors.Is(err, define.ErrNoSuchCtr) || errors.Is(err, define.ErrCtrRemoved) {
logrus.Infof("Ceasing signal forwarding to container %s as it has stopped", ctr.ID())
} else {
logrus.Errorf("forwarding signal %d to container %s: %v", s, ctr.ID(), err)