diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-09-27 15:08:14 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-27 15:08:14 -0700 |
commit | e87012de126a701a5afce73bea3811a540059f65 (patch) | |
tree | fb2195f0ac1b00934dfa200a994ee15d5759955f /libpod/container_internal.go | |
parent | 0fb807dd6bec8daae02bdab40f0f8d14b9353cb5 (diff) | |
parent | 407fba49425ebfa615b3d1c558d79ec1b82622fc (diff) | |
download | podman-e87012de126a701a5afce73bea3811a540059f65.tar.gz podman-e87012de126a701a5afce73bea3811a540059f65.tar.bz2 podman-e87012de126a701a5afce73bea3811a540059f65.zip |
Merge pull request #4065 from mheon/unconditional_conmon_rm
Unconditionally remove conmon files before starting
Diffstat (limited to 'libpod/container_internal.go')
-rw-r--r-- | libpod/container_internal.go | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/libpod/container_internal.go b/libpod/container_internal.go index 7403a216b..f1456548b 100644 --- a/libpod/container_internal.go +++ b/libpod/container_internal.go @@ -646,14 +646,8 @@ func (c *Container) removeConmonFiles() error { // Remove the exit file so we don't leak memory in tmpfs exitFile := filepath.Join(c.ociRuntime.exitsDir, c.ID()) - if _, err := os.Stat(exitFile); err != nil { - if !os.IsNotExist(err) { - return errors.Wrapf(err, "error running stat on container %s exit file", c.ID()) - } - } else { - if err := os.Remove(exitFile); err != nil { - return errors.Wrapf(err, "error removing container %s exit file", c.ID()) - } + if err := os.Remove(exitFile); err != nil && !os.IsNotExist(err) { + return errors.Wrapf(err, "error removing container %s exit file", c.ID()) } return nil @@ -922,6 +916,12 @@ func (c *Container) init(ctx context.Context, retainRetries bool) error { span.SetTag("struct", "container") defer span.Finish() + // Unconditionally remove conmon temporary files. + // We've been running into far too many issues where they block startup. + if err := c.removeConmonFiles(); err != nil { + return err + } + // Generate the OCI newSpec newSpec, err := c.generateSpec(ctx) if err != nil { |