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: avoid fetching empty metrics #98

Merged
merged 1 commit into from
Jun 8, 2023

Conversation

cheney-lin
Copy link
Member

As metricsFetcher.GetContainerMetric and cpuResourceAdvisor.update are called in separate goroutines, the latter may be executed before the former, resulting in obtaining empty metrics and falling back to using pod requests as estimated resources, which leads to a sharp decrease in headroom.

What type of PR is this?

Bug fixes

What this PR does / why we need it:

Which issue(s) this PR fixes:

Special notes for your reviewer:

As metricsFetcher.GetContainerMetric and cpuResourceAdvisor.update are called in separate goroutines,
the latter may be executed before the former, resulting in obtaining empty metrics and
falling back to using pod requests as estimated resources, which leads to a sharp decrease in headroom.

Signed-off-by: linzhecheng <linzhecheng@bytedance.com>
@cheney-lin cheney-lin force-pushed the dev/get_empty_metrics branch from 249e39e to 7de0407 Compare June 7, 2023 15:02
@cheney-lin cheney-lin added bug Something isn't working workflow/need-review review: test succeeded, need to review labels Jun 7, 2023
@cheney-lin cheney-lin requested a review from sun-yuliang June 7, 2023 15:02
@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 Jun 8, 2023
@waynepeking348 waynepeking348 merged commit 3b403aa into kubewharf:main Jun 8, 2023
@cheney-lin cheney-lin deleted the dev/get_empty_metrics branch September 13, 2023 06:31
luomingmeng pushed a commit to luomingmeng/katalyst-core that referenced this pull request Oct 11, 2024
As metricsFetcher.GetContainerMetric and cpuResourceAdvisor.update are called in separate goroutines,
the latter may be executed before the former, resulting in obtaining empty metrics and
falling back to using pod requests as estimated resources, which leads to a sharp decrease in headroom.

Signed-off-by: linzhecheng <linzhecheng@bytedance.com>
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