diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2018-11-07 09:19:28 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-07 09:19:28 -0800 |
commit | 1e1aaac97d795b5c94f3c714d3d240d48c5efb97 (patch) | |
tree | 514b975b4a6ba48d7d2a486190ec129b4dbe6c1e /libpod | |
parent | 1e4e33b41f1ce11b031d92b7800915714c504602 (diff) | |
parent | 3bacacce94089c4104cea0fff0f2945c22fc4813 (diff) | |
download | podman-1e1aaac97d795b5c94f3c714d3d240d48c5efb97.tar.gz podman-1e1aaac97d795b5c94f3c714d3d240d48c5efb97.tar.bz2 podman-1e1aaac97d795b5c94f3c714d3d240d48c5efb97.zip |
Merge pull request #1767 from mheon/remove_conmon_cgroup_first
Remove conmon cgroup before pod cgroup for cgroupfs
Diffstat (limited to 'libpod')
-rw-r--r-- | libpod/runtime_pod_linux.go | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/libpod/runtime_pod_linux.go b/libpod/runtime_pod_linux.go index eb3d471dd..3d6fad52f 100644 --- a/libpod/runtime_pod_linux.go +++ b/libpod/runtime_pod_linux.go @@ -265,15 +265,26 @@ func (r *Runtime) removePod(ctx context.Context, p *Pod, removeCtrs, force bool) } case CgroupfsCgroupsManager: // Delete the cgroupfs cgroup + // Make sure the conmon cgroup is deleted first + // Since the pod is almost gone, don't bother failing + // hard - instead, just log errors. v1CGroups := GetV1CGroups(getExcludedCGroups()) + conmonCgroupPath := filepath.Join(p.state.CgroupPath, "conmon") + conmonCgroup, err := cgroups.Load(v1CGroups, cgroups.StaticPath(conmonCgroupPath)) + if err != nil && err != cgroups.ErrCgroupDeleted { + return err + } + if err == nil { + if err := conmonCgroup.Delete(); err != nil { + logrus.Errorf("Error deleting pod %s conmon cgroup %s: %v", p.ID(), conmonCgroupPath, err) + } + } cgroup, err := cgroups.Load(v1CGroups, cgroups.StaticPath(p.state.CgroupPath)) if err != nil && err != cgroups.ErrCgroupDeleted { return err - } else if err == nil { + } + if err == nil { if err := cgroup.Delete(); err != nil { - // The pod is already almost gone. - // No point in hard-failing if we fail - // this bit of cleanup. logrus.Errorf("Error deleting pod %s cgroup %s: %v", p.ID(), p.state.CgroupPath, err) } } |