-
Notifications
You must be signed in to change notification settings - Fork 347
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
libcgroups v2 manager stats failed when no hugetlb releated files #2512
Comments
Hey, thanks for reporting this. Can you also add your system information / setup and how you were running this, so we can try to reproduce? |
I am using archlinux
pub fn show_cgroup_info<M>(manager: &M, name: &str) -> anyhow::Result<CgroupInfo>
where
M: CgroupManager,
M::Error: Error + Send + Sync + 'static,
{
let stats = manager
.stats()
.with_context(|| format!("get cgroup {name} info failed"))?;
let memory = (stats.memory.memory.limit != u64::MAX)
.then(|| Byte::from_bytes(stats.memory.memory.limit as _));
Ok(CgroupInfo {
cpu: CpuInfo {
cpu: MaxOrInt::Int(0),
},
memory: MemoryInfo { limit: memory },
})
} and when I call this function, I use the v2 manager implement |
The I think a potential solution is to implement a method similar to |
if a cgroup doesn't contain hugetlb releated files, the v2 manager will fail with
The text was updated successfully, but these errors were encountered: