diff options
author | Matthew Heon <matthew.heon@pm.me> | 2022-05-16 10:53:11 -0400 |
---|---|---|
committer | Matthew Heon <matthew.heon@pm.me> | 2022-05-16 10:53:11 -0400 |
commit | dc435ecb22fed044ccc348428cbd8160b36977f2 (patch) | |
tree | e456929a98c3dee3805073c35f78deba46d7e777 /libpod | |
parent | b94595bdfca2b6f4e69360c806a38b3990ff6f48 (diff) | |
download | podman-dc435ecb22fed044ccc348428cbd8160b36977f2.tar.gz podman-dc435ecb22fed044ccc348428cbd8160b36977f2.tar.bz2 podman-dc435ecb22fed044ccc348428cbd8160b36977f2.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>
Diffstat (limited to 'libpod')
-rw-r--r-- | libpod/runtime_ctr.go | 6 |
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 |