summaryrefslogtreecommitdiff
path: root/libpod
diff options
context:
space:
mode:
authorMatthew Heon <mheon@redhat.com>2020-04-15 16:52:50 -0400
committerMatthew Heon <matthew.heon@pm.me>2020-05-14 16:56:01 -0400
commitc76cf1735c1c9ec36abdf76d6c72b3f758d3d341 (patch)
treeca94189148a8cbe40f9202893628a8c39b103fcb /libpod
parentcf1f13af986b1e81bc17f58aae428610c14afc4f (diff)
downloadpodman-c76cf1735c1c9ec36abdf76d6c72b3f758d3d341.tar.gz
podman-c76cf1735c1c9ec36abdf76d6c72b3f758d3d341.tar.bz2
podman-c76cf1735c1c9ec36abdf76d6c72b3f758d3d341.zip
Don't fail when saving exec status fails on removed ctr
We can't save the exec session, but it's because the container is entirely gone, so no point erroring. Signed-off-by: Matthew Heon <mheon@redhat.com>
Diffstat (limited to 'libpod')
-rw-r--r--libpod/container_exec.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/libpod/container_exec.go b/libpod/container_exec.go
index 8ae9df1ae..979594eb4 100644
--- a/libpod/container_exec.go
+++ b/libpod/container_exec.go
@@ -922,6 +922,12 @@ func writeExecExitCode(c *Container, sessionID string, exitCode int) error {
// If we can't do this, no point in continuing, any attempt to save
// would write garbage to the DB.
if err := c.syncContainer(); err != nil {
+ if errors.Cause(err) == define.ErrNoSuchCtr || errors.Cause(err) == define.ErrCtrRemoved {
+ // Container's entirely removed. We can't save status,
+ // but the container's entirely removed, so we don't
+ // need to. Exit without error.
+ return nil
+ }
return errors.Wrapf(err, "error syncing container %s state to remove exec session %s", c.ID(), sessionID)
}