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

Add non-panicking variants to `cgroups_rs::memory::MemController::memory_stat` #137

Closed sisungo closed 5 months ago

sisungo commented 5 months ago

Which feature do you think can be improved? When cgroup2 filesystem is unmounted as the program is running and the method is called later, the method triggers a panic!(). The panic is located at .unwrap() at line 587 in memory.rs.

This behavior is not documented and may make things like writing the init daemon have an unexpected behavior.

How can it be improved? This issue request to add a non-panicking variant to methods like this. The non-panicking methods may have names like try_xxx() and returns a Result<_>.

sisungo commented 5 months ago

Duplicates with #116.