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
bug: memory.memsw.usage_in_bytes : no such file or directory #5
Comments
First is the panic coming from your code or this cgroups package? If its coming from the package can you post the stack and I can fix it or you can submit a PR if you have time. To fix this fast you should be able to pass an error handler for the stats function. This is one already in this package to ignore isnotexist errors. control.Stats(cgroups.IgnoreNotExists) You could also make your own ErrorHander func and pass to that method if you want it to do other things. |
oh, |
P.S. May be it's worthy to be noticed in README.md? |
Ya, we can put an example in the readme |
I'm running into the same issue. If you pass |
The changes introduced in this PR should help dealing with this issue: #98 |
Hi there!
I have a problems with Stat() function in cgroups package:
Code example(approximately):
It's just a part of a code, but its quite simple for seeing the logic I go through.
But when I try to run it:
cgroupName
is moved, it's ok./sys/fs/cgroup/memory/somecgroupname/memory.memsw.usage_in_bytes: no such file or directory
So, what have I found:
memory.memsw.usage_in_bytes
file isnt always present in system because its optionaly cgroups feature that could be activated by passingswapaccount=1
into kernel (actualy, I'm using Ubunt/Debian systems in my environment, so I have the same situation as I linked you to)Additional links about kernel parameters that has impackt to file existing factor:
http://cateee.net/lkddb/web-lkddb/MEMCG_SWAP.html
http://cateee.net/lkddb/web-lkddb/MEMCG_SWAP_ENABLED.html.
So, it looks like we need some check about if the file exists or it doesnt to prevent that kind of panic.
May be I will try to figure it out by myself and create PR then, but if you have enough time and see quite easy way to do it, it would be nice.
Anyway, thank you for opensourcing that again!
The text was updated successfully, but these errors were encountered: