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

fix(spd): parseBaselineCoefficient returns error if BaselineCoefficient is empty #388

Merged
merged 1 commit into from
Dec 1, 2023

Conversation

cheney-lin
Copy link
Member

@cheney-lin cheney-lin commented Nov 30, 2023

What type of PR is this?

Bug fixes

What this PR does / why we need it:

If baselinePercent is set as 100%, annotation.SPDAnnotationBaselinePercentileKey will
be updated as empty, error occurs when parseBaselineCoefficient, which prints as followed:
"[update] [qosaware-memory] update headroom policy failed" err="index 0 cannot parse: strconv.Atoi: parsing \"\": invalid syntax" headroomPolicy=numa-aware

By the way, I refined relative logic, removing confuesd BaselinePercentile value and replace by human readable sentinel pod.

Which issue(s) this PR fixes:

Special notes for your reviewer:

@cheney-lin cheney-lin force-pushed the fix/spd branch 6 times, most recently from 30c3311 to 69474ad Compare November 30, 2023 13:42
Copy link

codecov bot commented Nov 30, 2023

Codecov Report

Attention: 15 lines in your changes are missing coverage. Please review.

Comparison is base (512253f) 53.30% compared to head (e8648d2) 53.26%.

Files Patch % Lines
pkg/util/spd_baseline.go 71.05% 7 Missing and 4 partials ⚠️
pkg/controller/spd/spd_baseline.go 80.00% 2 Missing ⚠️
pkg/util/spd.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #388      +/-   ##
==========================================
- Coverage   53.30%   53.26%   -0.04%     
==========================================
  Files         439      439              
  Lines       48429    48408      -21     
==========================================
- Hits        25816    25786      -30     
- Misses      19685    19693       +8     
- Partials     2928     2929       +1     
Flag Coverage Δ
unittest 53.26% <71.15%> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@cheney-lin cheney-lin force-pushed the fix/spd branch 4 times, most recently from 5954974 to efb49ea Compare November 30, 2023 14:50
@cheney-lin cheney-lin changed the title WIP fix(spd): parse percentile error fix(spd): parseBaselineCoefficient returns error if BaselineCoefficient is empty Nov 30, 2023
@cheney-lin cheney-lin added bug Something isn't working workflow/need-review review: test succeeded, need to review labels Nov 30, 2023
@cheney-lin cheney-lin force-pushed the fix/spd branch 3 times, most recently from 7ffd5eb to 2033307 Compare December 1, 2023 02:12
waynepeking348
waynepeking348 previously approved these changes Dec 1, 2023
)

type BaselineCoefficient []int64
type PodMeta struct {
Copy link
Collaborator

Choose a reason for hiding this comment

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

To avoid conflict with other definitions, consider adding a prefix of spd baseline

Copy link
Member Author

Choose a reason for hiding this comment

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

modified

…nt is empty

If baselinePercent is set as 100%, annotation.SPDAnnotationBaselinePercentileKey will
be updated as empty, error occurs when parseBaselineCoefficient, which prints as followed:
"[update] [qosaware-memory] update headroom policy failed" err="index 0 cannot parse: strconv.Atoi: parsing \"\": invalid syntax" headroomPolicy=numa-aware

By the way, I refined relative logic, removing confuesd BaselinePercentile value and replace by human readable sentinel pod.
Signed-off-by: linzhecheng <linzhecheng@bytedance.com>
@cheney-lin cheney-lin added workflow/merge-ready merge-ready: code is ready and can be merged and removed workflow/need-review review: test succeeded, need to review labels Dec 1, 2023
@waynepeking348 waynepeking348 merged commit b3dbf0f into kubewharf:main Dec 1, 2023
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working workflow/merge-ready merge-ready: code is ready and can be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants