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

cgroup: fix race condition when enabling controllers #758

Merged
merged 2 commits into from
Oct 19, 2021

Conversation

giuseppe
Copy link
Member

It seems the kernel can return EBUSY when a process was moved to a sub-cgroup and the controllers are enabled in its parent cgroup.

On EBUSY retry a few times until a controller could be enabled.

Reported: containers/podman#9752

Signed-off-by: Giuseppe Scrivano [email protected]

libcrun_container_restore_linux_criu already sets the external
descriptors.

commit 979f6f0 introduced the
regression.

Signed-off-by: Giuseppe Scrivano <[email protected]>
src/libcrun/cgroup.c Outdated Show resolved Hide resolved
It seems the kernel can return EBUSY when a process was moved to a
sub-cgroup and the controllers are enabled in its parent cgroup.

On EBUSY retry a few times until a controller could be enabled.

Reported: containers/podman#9752

Signed-off-by: Giuseppe Scrivano <[email protected]>
@flouthoc
Copy link
Collaborator

LGTM

{
if (crun_error_get_errno (err) == EBUSY)
repeat = true;
crun_error_release (err);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should there be any sleep or something here?

@rhatdan
Copy link
Member

rhatdan commented Oct 19, 2021

LGTM

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