Skip to content

Commit 2077218

Browse files
Merge pull request #4009 from baude/execrmsocket
clean up after healthcheck execs
2 parents 1ddfc11 + 7b68cd0 commit 2077218

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

libpod/container_internal.go

+9-1
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,15 @@ func (c *Container) createExecBundle(sessionID string) (err error) {
163163

164164
// cleanup an exec session after its done
165165
func (c *Container) cleanupExecBundle(sessionID string) error {
166-
return os.RemoveAll(c.execBundlePath(sessionID))
166+
if err := os.RemoveAll(c.execBundlePath(sessionID)); err != nil && !os.IsNotExist(err) {
167+
return err
168+
}
169+
// Clean up the sockets dir. Issue #3962
170+
// Also ignore if it doesn't exist for some reason; hence the conditional return below
171+
if err := os.RemoveAll(filepath.Join(c.ociRuntime.socketsDir, sessionID)); err != nil && !os.IsNotExist(err) {
172+
return err
173+
}
174+
return nil
167175
}
168176

169177
// the path to a containers exec session bundle

0 commit comments

Comments
 (0)