Commit 135a548f authored by Kirill Smelkov's avatar Kirill Smelkov

X wcfs: Do not fail if to-be-killed process exited by itself and was waited by its parent

parent cd6d0b71
...@@ -586,10 +586,17 @@ func isProcessAlive(proc *os.Process) (_ bool, err error) { ...@@ -586,10 +586,17 @@ func isProcessAlive(proc *os.Process) (_ bool, err error) {
// pid exists. Check if proc is not zombie // pid exists. Check if proc is not zombie
gproc, err := process.NewProcess(int32(proc.Pid)) gproc, err := process.NewProcess(int32(proc.Pid))
if err != nil { if err != nil {
// XXX can fail even if ^^^ signal was ok (race)
return false, err return false, err
} }
statusv, err := gproc.Status() statusv, err := gproc.Status()
if err != nil { if err != nil {
// XXX isAlive pid804199: open /proc/804199/status: no such file or directory
// ref:Zzj45iDT1E4PakvG@deca.navytux.spb.ru
var e syscall.Errno
if errors.As(err, &e) && e == syscall.ENOENT {
err = nil
}
return false, err return false, err
} }
for _, status := range statusv { for _, status := range statusv {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment