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

Commit

Permalink
Merge pull request #275 from sboeuf/fix_k8s_shim_killed
Browse files Browse the repository at this point in the history
virtcontainers: Properly remove the container when shim gets killed
  • Loading branch information
grahamwhaley authored Apr 30, 2018
2 parents e78941e + 789dbca commit f92d7dd
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions virtcontainers/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -665,6 +665,16 @@ func (c *Container) stop() error {
}
}

// Force the container to be killed. For most of the cases, this
// should not matter and it should return an error that will be
// ignored.
// But for the specific case where the shim has been SIGKILL'ed,
// the container is still running inside the VM. And this is why
// this signal will ensure the container will get killed to match
// the state of the shim. This will allow the following call to
// stopContainer() to succeed in such particular case.
c.sandbox.agent.killContainer(*(c.sandbox), *c, syscall.SIGKILL, true)

if err := c.sandbox.agent.stopContainer(*(c.sandbox), *c); err != nil {
return err
}
Expand Down

0 comments on commit f92d7dd

Please sign in to comment.