Fix flaky nil pointer in signal forwarding to child process (see https://github.com/docker/api/runs/949400778)

This commit is contained in:
Guillaume Tardif 2020-08-06 10:23:12 +02:00
parent 6c66f38870
commit cdd4028788
1 changed files with 3 additions and 0 deletions

View File

@ -69,6 +69,9 @@ func Exec() {
for {
select {
case sig := <-signals:
if cmd.Process == nil {
continue // can happen if receiving signal before the process is actually started
}
err := cmd.Process.Signal(sig)
if err != nil {
fmt.Printf("WARNING could not forward signal %s to %s : %s\n", sig.String(), ComDockerCli, err.Error())