mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-09-16 14:28:35 +00:00
Merge pull request #691 from lifupan/wait_before_remove
virtcontainers: wait until process exited before RemoveContainer
This commit is contained in:
@@ -890,6 +890,12 @@ func (c *Container) stop() error {
|
||||
// stopContainer() to succeed in such particular case.
|
||||
c.kill(syscall.SIGKILL, true)
|
||||
|
||||
// Since the agent has supported the MultiWaitProcess, it's better to
|
||||
// wait the process here to make sure the process has exited before to
|
||||
// issue stopContainer, otherwise the RemoveContainerRequest in it will
|
||||
// get failed if the process hasn't exited.
|
||||
c.sandbox.agent.waitProcess(c, c.id)
|
||||
|
||||
if err := c.sandbox.agent.stopContainer(c.sandbox, *c); err != nil {
|
||||
return err
|
||||
}
|
||||
|
Reference in New Issue
Block a user