mirror of
https://github.com/containers/podman.git
synced 2025-07-03 09:17:15 +08:00
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:
@ -33,7 +33,8 @@ func ProxySignals(ctr *libpod.Container) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if err := ctr.Kill(uint(syscallSignal)); err != nil {
|
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())
|
logrus.Infof("Ceasing signal forwarding to container %s as it has stopped", ctr.ID())
|
||||||
} else {
|
} else {
|
||||||
logrus.Errorf("forwarding signal %d to container %s: %v", s, ctr.ID(), err)
|
logrus.Errorf("forwarding signal %d to container %s: %v", s, ctr.ID(), err)
|
||||||
|
Reference in New Issue
Block a user