Skip to content

Commit

Permalink
runtime: unpause the container before killing it
Browse files Browse the repository at this point in the history
the new version of runc has the same check in place and it
automatically resume the container if it is paused.  So when Podman
tries to resume it again, it fails since the container is not in the
paused state.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=2100740

[NO NEW TESTS NEEDED] the CI doesn't use a new runc on cgroup v1 systems.

Signed-off-by: Giuseppe Scrivano <[email protected]>
  • Loading branch information
giuseppe committed Jun 28, 2022
1 parent 653e87d commit 1affceb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions libpod/runtime_ctr.go
Original file line number Diff line number Diff line change
Expand Up @@ -664,9 +664,6 @@ func (r *Runtime) removeContainer(ctx context.Context, c *Container, force, remo
}

if c.state.State == define.ContainerStatePaused {
if err := c.ociRuntime.KillContainer(c, 9, false); err != nil {
return err
}
isV2, err := cgroups.IsCgroup2UnifiedMode()
if err != nil {
return err
Expand All @@ -677,6 +674,9 @@ func (r *Runtime) removeContainer(ctx context.Context, c *Container, force, remo
return err
}
}
if err := c.ociRuntime.KillContainer(c, 9, false); err != nil {
return err
}
// Need to update container state to make sure we know it's stopped
if err := c.waitForExitFileAndSync(); err != nil {
return err
Expand Down

0 comments on commit 1affceb

Please sign in to comment.