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

Freezer controller "doesn't exist" in v2 cgroup #124

Open
aviramha opened this issue Aug 22, 2023 · 0 comments
Open

Freezer controller "doesn't exist" in v2 cgroup #124

aviramha opened this issue Aug 22, 2023 · 0 comments
Labels
bug Something isn't working needs-review

Comments

@aviramha
Copy link

Describe the bug
Creating a cgroup with the freezer controller on v2 hierarchy fails with error
Error { kind: SpecifiedControllers, cause: None }

Expected behavior
It should succeed

Additional context
The freezer controller isn't mentioned in the cgroups file anymore, but is still available if accessing /sys/fs/cgroup/cgroup.freeze
I guess the API needs to be altered and can't be same for v1/v2?

        let hierarchy = cgroups_rs::hierarchies::auto();
        // get pids of all processes in the root cgroup
        let root_process_cgroup = cgroups_rs::Cgroup::load(hierarchy, "/proc/1/sys/fs/cgroup");
        let root_pids = root_process_cgroup.procs();

        let hierarchy = cgroups_rs::hierarchies::auto();
        // create new cgroup with freezer only, add this procs - this might exist from previous runs
        // of mirrord.
        let cgroup = cgroups_rs::Cgroup::new_with_specified_controllers(
            hierarchy,
            MIRRORD_CGROUP_PATH,
            Some(vec!["freezer".to_string()]),
        )?; // fails here
        for pid in root_pids {
            cgroup.add_task(pid)?;
        }
        let freezer_controller: &FreezerController = cgroup
            .controller_of()
            .ok_or(AgentError::PauseFailedCgroupFreezerNotFound)?;
        freezer_controller.freeze()?;
@aviramha aviramha added bug Something isn't working needs-review labels Aug 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs-review
Projects
None yet
Development

No branches or pull requests

1 participant