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

test: run --cgroups=split in new cgroup #12162

Conversation

giuseppe
Copy link
Member

@giuseppe giuseppe commented Nov 2, 2021

the --cgroups=split test changes the current cgroup as it creates a
sub-cgroup. This can cause a race condition in tests that are reading
the current cgroup.

Closes: #11191

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

What this PR does / why we need it:

How to verify it

Which issue(s) this PR fixes:

Special notes for your reviewer:

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 2, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: giuseppe

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 2, 2021
@giuseppe giuseppe force-pushed the run-split-test-in-separate-cgroup branch 2 times, most recently from b88cd65 to dbff072 Compare November 2, 2021 13:58
@TomSweeneyRedHat
Copy link
Member

LGTM
@edsantiago ?

@edsantiago
Copy link
Member

Seems to make sense, but I have a minor quibble with the Wrapper naming: it doesn't really communicate the fact that it is only used for systemd-run. I like reusability as much as the next person, but is it really necessary here? Could the code be more readable if named SystemdRun() or SafeCgroupRun or something more clearly indicative of its purpose?

@giuseppe giuseppe force-pushed the run-split-test-in-separate-cgroup branch from dbff072 to 765b23c Compare November 4, 2021 06:28
@giuseppe
Copy link
Member Author

giuseppe commented Nov 4, 2021

Could the code be more readable if named SystemdRun() or SafeCgroupRun or something more clearly indicative of its purpose?

sure, good suggestion.

I've pushed a new version that uses PodmanSystemdScope()

@giuseppe giuseppe force-pushed the run-split-test-in-separate-cgroup branch from 765b23c to d025608 Compare November 4, 2021 06:48
@@ -1381,13 +1381,13 @@ USER mail`, BB)
}
}

container := podmanTest.Podman([]string{"run", "--rm", "--cgroups=split", ALPINE, "cat", "/proc/self/cgroup"})
container := podmanTest.PodmanSystemdScope([]string{"run", "--rm", "--cgroups=split", ALPINE, "cat", "/proc/self/cgroup"}, wrapper)
Copy link
Member

Choose a reason for hiding this comment

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

New code LGTM but wrapper is no longer applicable here

@giuseppe giuseppe force-pushed the run-split-test-in-separate-cgroup branch from d025608 to f868e54 Compare November 4, 2021 12:03
@rhatdan
Copy link
Member

rhatdan commented Nov 4, 2021

/hold
/lgtm

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 4, 2021
@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Nov 4, 2021
the --cgroups=split test changes the current cgroup as it creates a
sub-cgroup.  This can cause a race condition in tests that are reading
the current cgroup.

Closes: containers#11191

Signed-off-by: Giuseppe Scrivano <[email protected]>
@giuseppe giuseppe force-pushed the run-split-test-in-separate-cgroup branch from f868e54 to 0234b15 Compare November 4, 2021 12:16
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Nov 4, 2021
@edsantiago
Copy link
Member

/lgtm
/hold cancel

Thank you, @giuseppe

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 4, 2021
@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Nov 4, 2021
@openshift-merge-robot openshift-merge-robot merged commit c0351a7 into containers:main Nov 4, 2021
@cevich
Copy link
Member

cevich commented Nov 4, 2021

Thanks for tracking this down and fixing it @giuseppe. One less thing to cause future headaches.

@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 22, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

podman run --cgroups=disabled: missing "supervisor"
6 participants