Two reasons: 1) Files in a cgroup are not regular files. You cannot 'rm' them. You can only remove the directory using 'rmdir'
2) We want the creation/removal of a cgroup to be atomic. For example, assume the cgroup hierarchy is like the following: /cgroup -- hierarchy root /cgroup/a /cgroup/a/1 /cgroup/a/2 You want to remove the cgroup 'a'. If you use the recursive version, here is what will potentially happen: 1. cgroup 'a/1' is removed 2. cgroup 'a/2' cannot be removed because some tasks are still in the cgroup 3. cgroup 'a' cannot be removed since 'a/2' is not removed yet. In that case, we have a partial removal, which we don't expect. - Jie On Fri, Sep 28, 2012 at 2:10 PM, Vinod Kone <[email protected]> wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/7338/#review12026 > ----------------------------------------------------------- > > > > src/linux/cgroups.cpp > <https://reviews.apache.org/r/7338/#comment25646> > > I don't understand why recursive is not good here? > > > > src/linux/cgroups.cpp > <https://reviews.apache.org/r/7338/#comment25645> > > ditto > > > - Vinod Kone > > > On Sept. 28, 2012, 5:33 a.m., Jie Yu wrote: > > > > ----------------------------------------------------------- > > This is an automatically generated e-mail. To reply, visit: > > https://reviews.apache.org/r/7338/ > > ----------------------------------------------------------- > > > > (Updated Sept. 28, 2012, 5:33 a.m.) > > > > > > Review request for mesos and Benjamin Hindman. > > > > > > Description > > ------- > > > > The recent refactor changes break the assumptions in the cgroups code. > > > > > > Diffs > > ----- > > > > src/linux/cgroups.cpp cdafe6e > > third_party/libprocess/include/stout/os.hpp 13dbc71 > > > > Diff: https://reviews.apache.org/r/7338/diff/ > > > > > > Testing > > ------- > > > > make check. > > > > Tested on my vm (latest ubuntu 12.04) > > > > > > Thanks, > > > > Jie Yu > > > > > >
