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

stress: add field to set the oom score #3070

Merged
merged 5 commits into from
Mar 31, 2022

Conversation

YangKeao
Copy link
Member

Signed-off-by: YangKeao yangkeao@chunibyo.icu

What problem does this PR solve?

#3069, but still need to modify the document after this PR merged.

What's changed and how it works?

Add a new field to represent the oom_score_adj value of the mem stress process. The chaos-daemon will use choom to execute the process and set the oom_score_adj. If this value is set to -1000, the oom killer will always kill the target container.

Related changes

  • Need to update chaos-mesh/website
  • Need to update Dashboard UI

Signed-off-by: YangKeao <yangkeao@chunibyo.icu>
@ti-chi-bot
Copy link
Member

ti-chi-bot commented Mar 28, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • FingerLeader
  • cwen0

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

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

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@YangKeao YangKeao changed the title add field to set the oom score stress: add field to set the oom score Mar 28, 2022
@ti-chi-bot ti-chi-bot requested a review from STRRL March 28, 2022 06:38
@YangKeao YangKeao added chaos/stress feature/new Introduce a new feature and removed size/XXL labels Mar 28, 2022
@codecov
Copy link

codecov bot commented Mar 28, 2022

Codecov Report

Merging #3070 (41ad5c6) into master (98931bb) will decrease coverage by 0.22%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3070      +/-   ##
==========================================
- Coverage   38.20%   37.97%   -0.23%     
==========================================
  Files         105      105              
  Lines        9098     9108      +10     
==========================================
- Hits         3476     3459      -17     
- Misses       5315     5340      +25     
- Partials      307      309       +2     
Impacted Files Coverage Δ
pkg/bpm/bpm.go 55.00% <0.00%> (-0.77%) ⬇️
pkg/bpm/build_linux.go 32.65% <0.00%> (-2.91%) ⬇️
pkg/chaosdaemon/stress_server_linux.go 0.00% <0.00%> (ø)
.../workflow/controllers/workflow_entry_reconciler.go 46.03% <0.00%> (-9.00%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 98931bb...41ad5c6. Read the comment docs.

})
}
if stresschaos.Spec.Stressors.MemoryStressor != nil {
req.OomScoreAdj = int64(stresschaos.Spec.Stressors.MemoryStressor.OOMScoreAdj)
Copy link
Member

Choose a reason for hiding this comment

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

Why use int64 here? I found that everything else uses int except for proto.

Copy link
Member Author

Choose a reason for hiding this comment

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

Because the size of int depends on the implementation but is not part of the go language, the gRPC only allows using int32 or int64.

But anyway, I should use int32 here. I have submitted a commit to turn it into int32.

Signed-off-by: YangKeao <yangkeao@chunibyo.icu>
Copy link
Member

@FingerLeader FingerLeader left a comment

Choose a reason for hiding this comment

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

LGTM!

@cwen0
Copy link
Member

cwen0 commented Mar 31, 2022

@YangKeao Can you fix CI first?

Signed-off-by: YangKeao <yangkeao@chunibyo.icu>
@YangKeao
Copy link
Member Author

@YangKeao Can you fix CI first?

Fixed.

Copy link
Member

@cwen0 cwen0 left a comment

Choose a reason for hiding this comment

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

LGTM @YangKeao Remember to create an issue to trace the implementation of this feature on chaos dashboard.

@cwen0
Copy link
Member

cwen0 commented Mar 31, 2022

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: a9accf2

@ti-chi-bot
Copy link
Member

@YangKeao: Your PR was out of date, I have automatically updated it for you.

At the same time I will also trigger all tests for you:

/run-all-tests

If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

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 ti-community-infra/tichi repository.

@ti-chi-bot ti-chi-bot merged commit ace51f9 into chaos-mesh:master Mar 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants