Skip to content

Commit

Permalink
Merge pull request #1223 from yummypeng/fix-shim-exit-compete
Browse files Browse the repository at this point in the history
Remove kill(0) in `handleSigkilledShim()`
  • Loading branch information
hqhq authored Jul 25, 2017
2 parents 95adb6d + 883b41b commit 08888ce
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions runtime/process.go
Original file line number Diff line number Diff line change
Expand Up @@ -300,12 +300,6 @@ func (p *process) handleSigkilledShim(rst uint32, rerr error) (uint32, error) {
return rst, rerr
}

// Possible that the shim was SIGKILLED
e := unix.Kill(p.cmd.Process.Pid, 0)
if e != syscall.ESRCH {
return rst, rerr
}

// The shim was SIGKILLED
// We should get the container state first
// to make sure the container is not in
Expand All @@ -318,7 +312,11 @@ func (p *process) handleSigkilledShim(rst uint32, rerr error) (uint32, error) {
}

// Ensure we got the shim ProcessState
<-p.cmdDoneCh
select {
case <-p.cmdDoneCh:
case <-time.After(2 * time.Minute):
return rst, fmt.Errorf("could not get the shim ProcessState within two minutes")
}

shimStatus := p.cmd.ProcessState.Sys().(syscall.WaitStatus)
if shimStatus.Signaled() && shimStatus.Signal() == syscall.SIGKILL {
Expand Down

0 comments on commit 08888ce

Please sign in to comment.