Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
sandbox: do not fail SIGKILL
Browse files Browse the repository at this point in the history
Once we have found the container, we should never fail SIGKILL.
It is possible to fail to send SIGKILL because hypervisor might
be gone already. If we fail SIGKILL, upper layer cannot really
proceed to clean things up.

Also there is no need to save sandbox here as we did not change
any state.

Signed-off-by: Peng Tao <[email protected]>
  • Loading branch information
bergwolf committed Jul 23, 2019
1 parent bc4460e commit 835b6e9
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions virtcontainers/sandbox.go
Original file line number Diff line number Diff line change
Expand Up @@ -1180,14 +1180,15 @@ func (s *Sandbox) KillContainer(containerID string, signal syscall.Signal, all b
}

// Send a signal to the process.
if err := c.kill(signal, all); err != nil {
return err
}
err = c.kill(signal, all)

if err = s.storeSandbox(); err != nil {
return err
// SIGKILL should never fail otherwise it is
// impossible to clean things up.
if signal == syscall.SIGKILL {
return nil
}
return nil

return err
}

// DeleteContainer deletes a container from the sandbox
Expand Down

0 comments on commit 835b6e9

Please sign in to comment.