Skip to content

Add bounds on max oom_score_adj value for AdjustOOMScore#4845

Merged
estesp merged 1 commit intocontainerd:masterfrom
skaegi:oom_score-max
Dec 17, 2020
Merged

Add bounds on max oom_score_adj value for AdjustOOMScore#4845
estesp merged 1 commit intocontainerd:masterfrom
skaegi:oom_score-max

Conversation

@skaegi
Copy link
Copy Markdown
Contributor

@skaegi skaegi commented Dec 14, 2020

oom_score_adj must be in the range -1000 to 1000. In AdjustOOMScore if containerd's score is already at the maximum value we should set that value for the shim instead of trying to set 1001 which is invalid.

Fixes #4837

Signed-off-by: Simon Kaegi [email protected]

@k8s-ci-robot
Copy link
Copy Markdown

Hi @skaegi. Thanks for your PR.

I'm waiting for a containerd member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@mikebrow
Copy link
Copy Markdown
Member

/ok-to-test

@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented Dec 14, 2020

Build succeeded.

@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented Dec 14, 2020

Build succeeded.

@mikebrow mikebrow added this to the 1.4.4 milestone Dec 14, 2020
@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented Dec 14, 2020

Build succeeded.

@crosbymichael
Copy link
Copy Markdown
Member

Looks like you don't have a valid DCO on all commits. It is probably better if you just squash these commits together and make sure it's signed.

Copy link
Copy Markdown
Member

@mikebrow mikebrow left a comment

Choose a reason for hiding this comment

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

looking good see comment

Comment thread container_linux_test.go Outdated
oom_score_adj must be in the range -1000 to 1000. In AdjustOOMScore if containerd's score is already at the maximum value we should set that value for the shim instead of trying to set 1001 which is invalid.

Signed-off-by: Simon Kaegi <[email protected]>
@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented Dec 14, 2020

Build succeeded.

@skaegi
Copy link
Copy Markdown
Contributor Author

skaegi commented Dec 15, 2020

I wasn't sure how to write a unit test that exercised this particular case but did run a manual test to confirm our CI case works by patching docker:20-dind and validating in my environment where the oom_score_adj is 1000.

FROM golang:alpine as build
RUN apk add git make build-base btrfs-progs-dev && \
    go get github.com/containerd/containerd && \
    cd /go/src/github.com/containerd/containerd && \
    git fetch origin pull/4845/head:pr && git checkout pr && \
    make && make install

FROM docker:20-dind
COPY --from=build /usr/local/bin/ctr /usr/local/bin/
COPY --from=build /usr/local/bin/containerd /usr/local/bin/
COPY --from=build /usr/local/bin/containerd-shim /usr/local/bin/
COPY --from=build /usr/local/bin/containerd-shim-runc-v2 /usr/local/bin/

Is there anything more to do here?

The one failing test above seems unrelated and perhaps an intermittent issue??

    --- FAIL: TestSnapshotterSuite/DevMapperUsage (0.86s)
Error:         snapshotter_test.go:141: assertion failed: expression is false: layer2Usage.Size < sizeBytes+256*dmsetup.SectorSize

Copy link
Copy Markdown
Member

@estesp estesp left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Copy Markdown
Member

@mikebrow mikebrow left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Copy Markdown
Member

@cpuguy83 cpuguy83 left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cherry-picked/1.4.x PR commits are cherry picked into the release/1.4 branch ok-to-test priority/P1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

failed to adjust OOM score for shim: invalid argument error -- for docker:dind in Kubernetes

7 participants