Skip to content

Commit

Permalink
Ensure cgroup dirs are cleaned up properly
Browse files Browse the repository at this point in the history
Signed-off-by: Ed King <eking@pivotal.io>
  • Loading branch information
MissingRoberto authored and teddyking committed Sep 1, 2017
1 parent ed9c8d9 commit b72c42b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion libcontainer/cgroups/fs/apply_raw.go
Expand Up @@ -142,18 +142,19 @@ func (m *Manager) Apply(pid int) (err error) {
}
return err
}
m.Paths[sys.Name()] = p

if err := sys.Apply(d); err != nil {
if os.IsPermission(err) && m.Cgroups.Path == "" {
// If we didn't set a cgroup path, then let's defer the error here
// until we know whether we have set limits or not.
// If we hadn't set limits, then it's ok that we couldn't join this cgroup, because
// it will have the same limits as its parent.
delete(m.Paths, sys.Name())
continue
}
return err
}
m.Paths[sys.Name()] = p

}
return nil
Expand Down

0 comments on commit b72c42b

Please sign in to comment.