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

specgen: do not set OOMScoreAdj by default #13765

Merged

Conversation

giuseppe
Copy link
Member

@giuseppe giuseppe commented Apr 4, 2022

do not force a value of OOMScoreAdj=0 if it is wasn't specified by the
user.

Closes: #13731

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

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Apr 4, 2022

[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 Apr 4, 2022
@@ -348,8 +348,7 @@ func DefineCreateFlags(cmd *cobra.Command, cf *entities.ContainerCreateOptions,
)

oomScoreAdjFlagName := "oom-score-adj"
createFlags.IntVar(
&cf.OOMScoreAdj,
createFlags.Int64(
Copy link
Member

Choose a reason for hiding this comment

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

Flag should be Int and not Int64 since you cast later to an int again.

@@ -238,6 +238,15 @@ func CreateInit(c *cobra.Command, vals entities.ContainerCreateOptions, isInfra
vals.GroupAdd = groups
}

if c.Flags().Changed("oom-score-adj") {
val := c.Flag("oom-score-adj").Value.String()
Copy link
Member

Choose a reason for hiding this comment

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

use c.Flags().GetInt("oom-score-adj") instead

Comment on lines 27 to 29
if test $? -eq 0 ; then
echo libsubid
fi
Copy link
Member

Choose a reason for hiding this comment

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

This doesn't look related to this PR/commit

Copy link
Member

@vrothberg vrothberg left a comment

Choose a reason for hiding this comment

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

Thanks a lot, @giuseppe!

Which API are you referring to re: the breaking change? I fail to find the break in the remote API which we should keep stable.

@@ -24,6 +24,3 @@ int main() {
return 0;
}
EOF
if test $? -eq 0 ; then
echo libsubid
fi
Copy link
Member

Choose a reason for hiding this comment

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

Could you move that into a separate commit? We probably need to cherry-pick the OOM fix.

Copy link
Member Author

Choose a reason for hiding this comment

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

no that is some debug change that should not be committed

test/e2e/run_test.go Show resolved Hide resolved
@giuseppe giuseppe force-pushed the do-not-set-oom-score-adj branch 2 times, most recently from 029b813 to 8dd4809 Compare April 4, 2022 11:35
@vrothberg
Copy link
Member

@mheon PTAL, a candidate for another v4.0 backport.

@giuseppe giuseppe force-pushed the do-not-set-oom-score-adj branch from 8dd4809 to 2b5f57f Compare April 4, 2022 11:42

@test "podman run doesn't override oom-score-adj" {
current_oom_score_adj=$(cat /proc/self/oom_score_adj)
run_podman '?' run --rm $IMAGE cat /proc/self/oom_score_adj
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
run_podman '?' run --rm $IMAGE cat /proc/self/oom_score_adj
run_podman run --rm $IMAGE cat /proc/self/oom_score_adj

We should make sure exit code is 0 or is there a special reason to not check for that?

Copy link
Member Author

Choose a reason for hiding this comment

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

no, there is no good reason for doing it. I'll drop the ?

@giuseppe giuseppe force-pushed the do-not-set-oom-score-adj branch from 2b5f57f to 4456d9a Compare April 4, 2022 12:18
Copy link
Member

@vrothberg vrothberg left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

test/system/030-run.bats Outdated Show resolved Hide resolved
@giuseppe giuseppe force-pushed the do-not-set-oom-score-adj branch from 4456d9a to 9c8fe82 Compare April 4, 2022 12:42
do not force a value of OOMScoreAdj=0 if it is wasn't specified by the
user.

Closes: containers#13731

Signed-off-by: Giuseppe Scrivano <[email protected]>
@giuseppe giuseppe force-pushed the do-not-set-oom-score-adj branch from 9c8fe82 to 164b64e Compare April 4, 2022 13:41
Copy link
Member

@Luap99 Luap99 left a comment

Choose a reason for hiding this comment

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

LGTM

@mheon
Copy link
Member

mheon commented Apr 4, 2022

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Apr 4, 2022
@openshift-merge-robot openshift-merge-robot merged commit 4f31ade into containers:main Apr 4, 2022
@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 21, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 21, 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.

Cannot start podman systemd service
5 participants