Merge pull request #10837 from giuseppe/ignore-ESRCH

podman: ignore ESRCH from kill
This commit is contained in:
OpenShift Merge Robot 2021-07-01 12:53:00 -04:00 committed by GitHub
commit a855b30f81
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 2 deletions

View File

@ -268,7 +268,9 @@ func becomeRootInUserNS(pausePid, fileToRead string, fileOutput *os.File) (_ boo
}
if retErr != nil && pid > 0 {
if err := unix.Kill(pid, unix.SIGKILL); err != nil {
logrus.Errorf("failed to kill %d", pid)
if err != unix.ESRCH {
logrus.Errorf("failed to cleanup process %d: %v", pid, err)
}
}
C.reexec_in_user_namespace_wait(C.int(pid), 0)
}
@ -394,7 +396,9 @@ func becomeRootInUserNS(pausePid, fileToRead string, fileOutput *os.File) (_ boo
}
if err := unix.Kill(int(pidC), s.(unix.Signal)); err != nil {
logrus.Errorf("failed to kill %d", int(pidC))
if err != unix.ESRCH {
logrus.Errorf("failed to propagate signal to child process %d: %v", int(pidC), err)
}
}
}
}()