From 341e6a1628a35198500fcfc1bb65b377ff9b270b Mon Sep 17 00:00:00 2001 From: Matthew Heon Date: Wed, 19 May 2021 14:49:26 -0400 Subject: Always spawn a cleanup process with exec We were previously only doing this for detached exec. I don't know why we did that, but I don't see any reason not to extend it to all exec sessions - it guarantees that we will always clean up exec sessions, even if the original `podman exec` process died. [NO TESTS NEEDED] because I don't really know how to test this one. Signed-off-by: Matthew Heon --- libpod/container_exec.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'libpod') diff --git a/libpod/container_exec.go b/libpod/container_exec.go index c359f1e5d..09a5b9597 100644 --- a/libpod/container_exec.go +++ b/libpod/container_exec.go @@ -761,6 +761,9 @@ func (c *Container) Exec(config *ExecConfig, streams *define.AttachStreams, resi } exitCode := session.ExitCode if err := c.ExecRemove(sessionID, false); err != nil { + if errors.Cause(err) == define.ErrNoSuchExecSession { + return exitCode, nil + } return -1, err } -- cgit v1.2.3-54-g00ecf