Merge pull request #5036 from vrothberg/fix-5034

sigproxy: return after closing the channel
This commit is contained in:
OpenShift Merge Robot
2020-01-31 08:32:26 -08:00
committed by GitHub

View File

@ -25,11 +25,17 @@ func ProxySignals(ctr *libpod.Container) {
} }
if err := ctr.Kill(uint(s.(syscall.Signal))); err != nil { if err := ctr.Kill(uint(s.(syscall.Signal))); err != nil {
// 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) logrus.Errorf("Error forwarding signal %d to container %s: %v", s, ctr.ID(), err)
signal.StopCatch(sigBuffer) signal.StopCatch(sigBuffer)
if err := syscall.Kill(syscall.Getpid(), s.(syscall.Signal)); err != nil { if err := syscall.Kill(syscall.Getpid(), s.(syscall.Signal)); err != nil {
logrus.Errorf("failed to kill pid %d", syscall.Getpid()) logrus.Errorf("failed to kill pid %d", syscall.Getpid())
} }
return
} }
} }
}() }()