Skip to content
Permalink
Browse files

Merge pull request #2023 from LittleLightLittleFire/2022-fix-runc-zom…

…bie-process-regression

Fixes regression causing zombie runc:[1:CHILD] processes
  • Loading branch information...
crosbymichael committed Mar 22, 2019
2 parents dd22a84 + eab5330 commit 11fc498ffa5c4561eef9242e7f7115d57e57055b
Showing with 10 additions and 4 deletions.
  1. +10 −4 libcontainer/process_linux.go
@@ -158,10 +158,8 @@ func (p *setnsProcess) execSetns() error {
}

// Clean up the zombie parent process
firstChildProcess, err := os.FindProcess(pid.PidFirstChild)
if err != nil {
return err
}
// 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()
@@ -236,6 +234,14 @@ func (p *initProcess) getChildPid() (int, error) {
p.cmd.Wait()
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
}

0 comments on commit 11fc498

Please sign in to comment.
You can’t perform that action at this time.