containerd/cgroups

call control.Delete() occur err=cgroups: unable to remove path "/sys/fs/cgroup/devices/test"

ycchildcoder opened this issue · 1 comments

I write a test,when I call control.Delete() , it occur error:
err=cgroups: unable to remove path "/sys/fs/cgroup/devices/test"
inside
err= unlinkat /sys/fs/cgroup/devices/test/tasks: operation not permitted
I don't know why, when i remove control.Add(cgroups.Process{Pid: 1234}), it has not error。
thanks

Adding os.Remove() before os.RemoveAll() solves the issue?

if err := os.RemoveAll(path); err == nil {