Closed zhlhahaha closed 3 years ago
/assign @kevinGC
I did some investigation:
The CPUusage path comes from following code
https://github.com/google/gvisor/blob/47bc115158397024841aa3747be7558b2c317cbb/runsc/cgroup/cgroup.go#L298
As the cgroup.name
and the cgroup.parents
both contain user.slice
which lead to the wrong CPU usage path.
cgroup is trying to load information about the current process and not the sandbox process. Thus it gets confuses and builds the wrong path. I'm working on a fix...
Description
When running
bazel test //runsc/container:container_test --test_filter=TestMultiContainerEvent --cache_test_results=no
for sever times, it always failed with following message:Steps to reproduce I use following shell script to detect error
Environment
Please include the following details of your environment:
uname -a
Linux entos-x86-desktop-03 5.9.0git describe
(if built from source) release-20210419.0-11-g07a78ecb2runsc
debug logs (if available)As there is a message in the log
W0422 07:09:36.874078 23 container.go:1157] events: failed when getting cgroup CPU usage for container: open /sys/fs/cgroup/cpuacct/user.slice/user.slice/cpuacct.usage: no such file or directory
Theuser.slice
repeated twice in the path. I think this may be related to the commit 5f7bf31526.Would you like to take a look when you have time? @kevinGC