diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-10-30 18:19:29 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-30 18:19:29 +0100 |
commit | 5eebe3dd3d99a3e80d52e991bb4e133a00b7272b (patch) | |
tree | c610743f79a0944002c40c9b79ce430b915e8973 /pkg | |
parent | 7a68db33e137e227144486506548fe703498b8dd (diff) | |
parent | ed9edf840adbc159fb3ddc99638b3111440c8cfe (diff) | |
download | podman-5eebe3dd3d99a3e80d52e991bb4e133a00b7272b.tar.gz podman-5eebe3dd3d99a3e80d52e991bb4e133a00b7272b.tar.bz2 podman-5eebe3dd3d99a3e80d52e991bb4e133a00b7272b.zip |
Merge pull request #8191 from mheon/no_error_on_sigproxy_stopped
When container stops, drop sig-proxy errors to infos
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/domain/infra/abi/terminal/sigproxy_linux.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/pkg/domain/infra/abi/terminal/sigproxy_linux.go b/pkg/domain/infra/abi/terminal/sigproxy_linux.go index 0c586cf5c..2aca8f22d 100644 --- a/pkg/domain/infra/abi/terminal/sigproxy_linux.go +++ b/pkg/domain/infra/abi/terminal/sigproxy_linux.go @@ -5,8 +5,10 @@ import ( "syscall" "github.com/containers/podman/v2/libpod" + "github.com/containers/podman/v2/libpod/define" "github.com/containers/podman/v2/libpod/shutdown" "github.com/containers/podman/v2/pkg/signal" + "github.com/pkg/errors" "github.com/sirupsen/logrus" ) @@ -33,12 +35,16 @@ func ProxySignals(ctr *libpod.Container) { } if err := ctr.Kill(uint(s.(syscall.Signal))); err != nil { + if errors.Cause(err) == define.ErrCtrStateInvalid { + logrus.Infof("Ceasing signal forwarding to container %s as it has stopped", ctr.ID()) + } else { + logrus.Errorf("Error forwarding signal %d to container %s: %v", s, ctr.ID(), err) + } // If the container dies, and we find out here, // we need to forward that one signal to // ourselves so that it is not lost, and then // we terminate the proxy and let the defaults // play out. - logrus.Errorf("Error forwarding signal %d to container %s: %v", s, ctr.ID(), err) signal.StopCatch(sigBuffer) if err := syscall.Kill(syscall.Getpid(), s.(syscall.Signal)); err != nil { logrus.Errorf("failed to kill pid %d", syscall.Getpid()) |