kata-containers / cgroups-rs

Native Rust library for managing control groups under Linux
https://crates.io/crates/cgroups-rs
Other
116 stars 47 forks source link

notify_on_oom_v2 is being used in cgroup v2 #136

Open Eason0729 opened 5 months ago

Eason0729 commented 5 months ago

Describe the bug memory.oom_control is used in notify_on_oom_v2, if I recall correctly, memory.oom_control only exist in cgroup v1 when memory subsystem is mounted.

Expected behavior Return ErrorKind::Other, or document the behavior somewhere.

Additional context

called `Result::unwrap()` on an `Err` value: Error { kind: ReadFailed("/sys/fs/cgroup/abc.0/memory.oom_control"), cause: Some(Os { code: 2, kind: NotFound, message: "No such file or directory" }) }