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: retry opening a cgroup file #4442

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kolyshkin
Copy link
Contributor

From time to time we see unexpected errors (ENODEV or ENOENT) trying to write to a cgroup file. This is probably due to some races in the kernel.

Let's implement a retry when we see ENOENT or ENODEV, but only if a directory exists.

Note this can have a negative effect on performance when some cgroup features are disabled.

Fixes: #4136
Fixes: #3540
Fixes: #3351

@kolyshkin
Copy link
Contributor Author

Frankly, I don't know if we should have this or not.

@rata
Copy link
Member

rata commented Oct 14, 2024

I haven't checked in detail, but if it helps, crun is doing this: containers/crun#539.

@kolyshkin
Copy link
Contributor Author

I haven't checked in detail, but if it helps, crun is doing this: containers/crun#539.

I think we already do this (treat ENODEV in the same way as ENOENT).

@kolyshkin kolyshkin force-pushed the cg-retry branch 2 times, most recently from 255880c to 66ac49d Compare October 23, 2024 19:47
@kolyshkin
Copy link
Contributor Author

Frankly, I don't know how to properly test this (other than merge this and see if the flakes are gone).

From time to time we see unexpected errors (ENODEV or ENOENT) trying to
write to a cgroup file. This is probably due to some races in the
kernel.

Let's implement a retry when we see ENOENT or ENODEV, but only if a
directory exists.

Note this can have a negative effect on performance when some cgroup
features are disabled.

Signed-off-by: Kir Kolyshkin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants