Skip to content

Commit

Permalink
Merge pull request #8191 from mheon/no_error_on_sigproxy_stopped
Browse files Browse the repository at this point in the history
When container stops, drop sig-proxy errors to infos
  • Loading branch information
openshift-merge-robot authored Oct 30, 2020
2 parents 7a68db3 + ed9edf8 commit 5eebe3d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pkg/domain/infra/abi/terminal/sigproxy_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand All @@ -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())
Expand Down

0 comments on commit 5eebe3d

Please sign in to comment.