Skip to content
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

libct/cg: don't return OOMKillCount error when rootless #2910

Merged
merged 2 commits into from
Apr 15, 2021

Conversation

kolyshkin
Copy link
Contributor

PR #2812 (commit 5d0ffbf) added OOM kill count checking and better container
start/run/exec error reporting in case we hit OOM.

It also introduced warnings like these:

level=warning msg="unable to get oom kill count" error="openat2 /sys/fs/cgroup/user.slice/user-1000.slice/user@1000.service/test_hello/memory.events: no such file or directory"

In case of rootless containers, unless cgroup is delegated or systemd is
used, runc can not create a cgroup and thus it fails to get OOM kill
count. This is expected, and the warning should not be shown in this
case.

For fs, commit fc620fd made rootless field private,
and for fs2, it was always private, and yet comments in both
mention it as m.Rootless.

Fix it.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Commit 5d0ffbf added OOM kill count checking and better container
start/run/exec error reporting in case we hit OOM.

It also introduced warnings like these:

> level=warning msg="unable to get oom kill count" error="openat2
> /sys/fs/cgroup/user.slice/user-1000.slice/user@1000.service/test_hello/memory.events:
> no such file or directory"

In case of rootless containers, unless cgroup is delegated or systemd is
used, runc can not create a cgroup and thus it fails to get OOM kill
count. This is expected, and the warning should not be shown in this
case.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
@AkihiroSuda AkihiroSuda merged commit fce58ab into opencontainers:master Apr 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants