From c76cf1735c1c9ec36abdf76d6c72b3f758d3d341 Mon Sep 17 00:00:00 2001 From: Matthew Heon Date: Wed, 15 Apr 2020 16:52:50 -0400 Subject: 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 --- libpod/container_exec.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'libpod/container_exec.go') 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) } -- cgit v1.2.3-54-g00ecf