summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@pm.me>2022-05-16 10:53:11 -0400
committerMatthew Heon <mheon@redhat.com>2022-06-14 13:43:46 -0400
commit5549495f4ebb0c971c61ebae67d2aa6079213901 (patch)
tree5eb312db75c88e4773ca6ef59bc4984cc14a2c14
parent2b8a5843ecf3baa2b3bf3d60de9798fd0c562454 (diff)
downloadpodman-5549495f4ebb0c971c61ebae67d2aa6079213901.tar.gz
podman-5549495f4ebb0c971c61ebae67d2aa6079213901.tar.bz2
podman-5549495f4ebb0c971c61ebae67d2aa6079213901.zip
Make errors on removing exec sessions nonfatal
Removing exec sessions is guaranteed to evict them from the DB, but in the case of a zombie process (or similar) it may error and block removal of the container. A subsequent run of `podman rm` would succeed (because the exec sessions have been purged from the DB), which is potentially confusing to users. So let's just continue, instead of erroring out, if removing exec sessions fails. [NO NEW TESTS NEEDED] I wouldn't want to spawn a zombie in our test VMs even if I could. Fixes #14252 Signed-off-by: Matthew Heon <matthew.heon@pm.me>
-rw-r--r--libpod/runtime_ctr.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/libpod/runtime_ctr.go b/libpod/runtime_ctr.go
index df7174ac6..7e8a21a8c 100644
--- a/libpod/runtime_ctr.go
+++ b/libpod/runtime_ctr.go
@@ -732,7 +732,11 @@ func (r *Runtime) removeContainer(ctx context.Context, c *Container, force, remo
// after setting the state to ContainerStateRemoving will prevent that the container is
// restarted
if err := c.removeAllExecSessions(); err != nil {
- return err
+ if cleanupErr == nil {
+ cleanupErr = err
+ } else {
+ logrus.Errorf("Remove exec sessions: %v", err)
+ }
}
// Stop the container's storage