summaryrefslogtreecommitdiffhomepage
path: root/runsc/cgroup/cgroup.go
diff options
context:
space:
mode:
Diffstat (limited to 'runsc/cgroup/cgroup.go')
-rw-r--r--runsc/cgroup/cgroup.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/runsc/cgroup/cgroup.go b/runsc/cgroup/cgroup.go
index d6058a8a2..0ceeb3f28 100644
--- a/runsc/cgroup/cgroup.go
+++ b/runsc/cgroup/cgroup.go
@@ -190,7 +190,9 @@ func (c *Cgroup) Install(res *specs.LinuxResources) error {
// Mark that cgroup resources are owned by me.
log.Debugf("Creating cgroup %q", c.Name)
c.Own = true
- clean := specutils.MakeCleanup(func() { c.Uninstall() })
+ // The Cleanup object cleans up partially created cgroups when an error occurs.
+ // Errors occuring during cleanup itself are ignored.
+ clean := specutils.MakeCleanup(func() { _ = c.Uninstall() })
defer clean.Clean()
for key, ctrl := range controllers {