mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-30 09:13:29 +00:00
sandbox: do not fail SIGKILL
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 <bergwolf@hyper.sh>
This commit is contained in:
parent
bc4460e12f
commit
835b6e9e1b
@ -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)
|
||||
|
||||
// SIGKILL should never fail otherwise it is
|
||||
// impossible to clean things up.
|
||||
if signal == syscall.SIGKILL {
|
||||
return nil
|
||||
}
|
||||
|
||||
if err = s.storeSandbox(); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteContainer deletes a container from the sandbox
|
||||
|
Loading…
Reference in New Issue
Block a user