diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-04-11 09:31:44 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-11 09:31:44 -0700 |
commit | 4b9a4a12f17ecebb3647165430af9571de45d5bf (patch) | |
tree | 41eb9c70bc7794899abbed60904bc483c0b1b89b /libpod/runtime_ctr.go | |
parent | b281c34b317ff6f84757b590905c5ef5981863e0 (diff) | |
parent | 27d56c7f1531be9c82b3b81429048aa01e2b1248 (diff) | |
download | podman-4b9a4a12f17ecebb3647165430af9571de45d5bf.tar.gz podman-4b9a4a12f17ecebb3647165430af9571de45d5bf.tar.bz2 podman-4b9a4a12f17ecebb3647165430af9571de45d5bf.zip |
Merge pull request #2901 from mheon/improve_debug_on_cleanup_err
Expand debugging for container cleanup errors
Diffstat (limited to 'libpod/runtime_ctr.go')
-rw-r--r-- | libpod/runtime_ctr.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/libpod/runtime_ctr.go b/libpod/runtime_ctr.go index 800b42851..85b860268 100644 --- a/libpod/runtime_ctr.go +++ b/libpod/runtime_ctr.go @@ -372,7 +372,7 @@ func (r *Runtime) removeContainer(ctx context.Context, c *Container, force bool, // Clean up network namespace, cgroups, mounts if err := c.cleanup(ctx); err != nil { if cleanupErr == nil { - cleanupErr = err + cleanupErr = errors.Wrapf(err, "error cleaning up container %s", c.ID()) } else { logrus.Errorf("cleanup network, cgroups, mounts: %v", err) } @@ -404,12 +404,14 @@ func (r *Runtime) removeContainer(ctx context.Context, c *Container, force bool, // Deallocate the container's lock if err := c.lock.Free(); err != nil { if cleanupErr == nil { - cleanupErr = err + cleanupErr = errors.Wrapf(err, "error freeing lock for container %s", c.ID()) } else { logrus.Errorf("free container lock: %v", err) } } + c.newContainerEvent(events.Remove) + if !removeVolume { return cleanupErr } @@ -425,7 +427,6 @@ func (r *Runtime) removeContainer(ctx context.Context, c *Container, force bool, } } - c.newContainerEvent(events.Remove) return cleanupErr } |