Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v2: ToggleControllers() should toggle ancestors of c.path, not c.path itself #121

Closed
AkihiroSuda opened this issue Nov 15, 2019 · 3 comments · Fixed by #124
Closed

v2: ToggleControllers() should toggle ancestors of c.path, not c.path itself #121

AkihiroSuda opened this issue Nov 15, 2019 · 3 comments · Fixed by #124

Comments

@AkihiroSuda
Copy link
Member

AkihiroSuda commented Nov 15, 2019

func (c *Manager) ToggleControllers(controllers []string, t ControllerToggle) error {

ToggleControllers() should toggle ancestors of c.path, not c.path itself.

e.g. when c.path is like /foo/bar/baz, the following files need to be written:

  • /sys/fs/cgroup/foo/cgroup.subtree_control
  • /sys/fs/cgroup/foo/bar/cgroup.subtree_control

Note that /sys/fs/cgroup/foo/bar/baz/cgroup.subtree_control does not need to be written.

@AkihiroSuda
Copy link
Member Author

Aside from this, ToggleControllers() should return map[string]error rather than just single err.

@crosbymichael
Copy link
Member

Noooo, map[string]error is a horrible ux, there are better ways to handle this

@AkihiroSuda
Copy link
Member Author

like this then?

// toggleError implements error interface
type toggleError struct {
  failed map[string]struct{}
}

func (e toggleError) Error() string{
}

func (e toggleError) FailedControllers() map[string]struct{}{
}

AkihiroSuda added a commit to AkihiroSuda/containerd-cgroups that referenced this issue Nov 15, 2019
Fix containerd#121

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
AkihiroSuda added a commit to AkihiroSuda/containerd-cgroups that referenced this issue Nov 15, 2019
Fix containerd#121

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
AkihiroSuda added a commit to AkihiroSuda/containerd-cgroups that referenced this issue Nov 15, 2019
Fix containerd#121

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
AkihiroSuda added a commit to AkihiroSuda/containerd-cgroups that referenced this issue Nov 18, 2019
Fix containerd#121

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants