Merge pull request #2023 from LittleLightLittleFire/2022-fix-runc-zombie-process-regression
Fixes regression causing zombie runc:[1:CHILD] processes
This commit is contained in:
commit
11fc498ffa
|
@ -158,10 +158,8 @@ func (p *setnsProcess) execSetns() error {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clean up the zombie parent process
|
// Clean up the zombie parent process
|
||||||
firstChildProcess, err := os.FindProcess(pid.PidFirstChild)
|
// On Unix systems FindProcess always succeeds.
|
||||||
if err != nil {
|
firstChildProcess, _ := os.FindProcess(pid.PidFirstChild)
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
// Ignore the error in case the child has already been reaped for any reason
|
// Ignore the error in case the child has already been reaped for any reason
|
||||||
_, _ = firstChildProcess.Wait()
|
_, _ = firstChildProcess.Wait()
|
||||||
|
@ -236,6 +234,14 @@ func (p *initProcess) getChildPid() (int, error) {
|
||||||
p.cmd.Wait()
|
p.cmd.Wait()
|
||||||
return -1, err
|
return -1, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Clean up the zombie parent process
|
||||||
|
// On Unix systems FindProcess always succeeds.
|
||||||
|
firstChildProcess, _ := os.FindProcess(pid.PidFirstChild)
|
||||||
|
|
||||||
|
// Ignore the error in case the child has already been reaped for any reason
|
||||||
|
_, _ = firstChildProcess.Wait()
|
||||||
|
|
||||||
return pid.Pid, nil
|
return pid.Pid, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue