Skip to content

Conversation

sohankunkerkar
Copy link
Member

It resolves Pod InPlace Resize Container test failure where cpu.weight file was empty for Guaranteed QoS pods with restartable init containers. Sometimes, systemd fails to convert CPUShares → CPUWeight for this specific scenario, likely due to how it handles complex pod hierarchies with concurrent containers, but the exact internal mechanism is unclear. This acts more as a safeguard in case systemd doesn’t set the value.

What type of PR is this?

/kind bug
/kind flake

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes https://issues.redhat.com/browse/OCPBUGS-61220

Special notes for your reviewer:

Does this PR introduce a user-facing change?

Use systemd property as fallback for cpu weight

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 5, 2025
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Sep 5, 2025
@openshift-ci openshift-ci bot added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Sep 5, 2025
@openshift-ci-robot openshift-ci-robot added the jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. label Sep 5, 2025
@openshift-ci-robot
Copy link

@sohankunkerkar: This pull request references Jira Issue OCPBUGS-61220, which is invalid:

  • expected the bug to target the "4.21.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

In response to this:

It resolves Pod InPlace Resize Container test failure where cpu.weight file was empty for Guaranteed QoS pods with restartable init containers. Sometimes, systemd fails to convert CPUShares → CPUWeight for this specific scenario, likely due to how it handles complex pod hierarchies with concurrent containers, but the exact internal mechanism is unclear. This acts more as a safeguard in case systemd doesn’t set the value.

What type of PR is this?

/kind bug
/kind flake

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes https://issues.redhat.com/browse/OCPBUGS-61220

Special notes for your reviewer:

Does this PR introduce a user-facing change?

Use systemd property as fallback for cpu weight

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci bot added the dco-signoff: yes Indicates the PR's author has DCO signed all their commits. label Sep 5, 2025
Copy link
Contributor

openshift-ci bot commented Sep 5, 2025

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci openshift-ci bot added kind/bug Categorizes issue or PR as related to a bug. kind/flake Categorizes issue or PR as related to a flaky test. labels Sep 5, 2025
Copy link
Contributor

openshift-ci bot commented Sep 5, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sohankunkerkar

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 Sep 5, 2025
Copy link

codecov bot commented Sep 5, 2025

Codecov Report

❌ Patch coverage is 85.71429% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 67.05%. Comparing base (d3b6c3c) to head (2172b77).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9456      +/-   ##
==========================================
+ Coverage   66.96%   67.05%   +0.09%     
==========================================
  Files         202      202              
  Lines       27997    28016      +19     
==========================================
+ Hits        18747    18786      +39     
+ Misses       7673     7656      -17     
+ Partials     1577     1574       -3     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@openshift-ci-robot
Copy link

@sohankunkerkar: This pull request references Jira Issue OCPBUGS-61220. The bug has been updated to no longer refer to the pull request using the external bug tracker. All external bug links have been closed. The bug has been moved to the NEW state.

In response to this:

It resolves Pod InPlace Resize Container test failure where cpu.weight file was empty for Guaranteed QoS pods with restartable init containers. Sometimes, systemd fails to convert CPUShares → CPUWeight for this specific scenario, likely due to how it handles complex pod hierarchies with concurrent containers, but the exact internal mechanism is unclear. This acts more as a safeguard in case systemd doesn’t set the value.

What type of PR is this?

/kind bug
/kind flake

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes https://issues.redhat.com/browse/OCPBUGS-61220

Special notes for your reviewer:

Does this PR introduce a user-facing change?

Use systemd property as fallback for cpu weight

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 openshift-eng/jira-lifecycle-plugin repository.

@sohankunkerkar sohankunkerkar reopened this Sep 7, 2025
@openshift-ci-robot
Copy link

@sohankunkerkar: This pull request references Jira Issue OCPBUGS-61220, which is invalid:

  • expected the bug to target the "4.21.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

In response to this:

It resolves Pod InPlace Resize Container test failure where cpu.weight file was empty for Guaranteed QoS pods with restartable init containers. Sometimes, systemd fails to convert CPUShares → CPUWeight for this specific scenario, likely due to how it handles complex pod hierarchies with concurrent containers, but the exact internal mechanism is unclear. This acts more as a safeguard in case systemd doesn’t set the value.

What type of PR is this?

/kind bug
/kind flake

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes https://issues.redhat.com/browse/OCPBUGS-61220

Special notes for your reviewer:

Does this PR introduce a user-facing change?

Use systemd property as fallback for cpu weight

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 openshift-eng/jira-lifecycle-plugin repository.

Name: "CPUShares",
Value: dbus.MakeVariant(resources.CPU.Shares),
})
if node.CgroupIsV2() {
Copy link
Member

Choose a reason for hiding this comment

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

I'm curious why the IPPR test fails when conmon cgroup doesn't have cpu weight set. it's checking the pod cgroup weight and that's the culmination of its child cgroups?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think the pod-level cgroup aggregates CPU weights from all its children, including conmon. If conmon’s cgroup has no cpu.weight, it defaults to 100, which can make the pod-level weight inconsistent. This will avoid that issue.

Copy link
Contributor

Choose a reason for hiding this comment

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

Looking at the log, it checked /sys/fs/cgroup/cpu.weight in the target container (c1-init) and it was empty.
Is it a pod level cgroup? It looks like container-level.

Copy link
Member

Choose a reason for hiding this comment

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

yeah sounds like container level. @sohankunkerkar this fix did fix the test for you though?

@sohankunkerkar sohankunkerkar marked this pull request as ready for review September 8, 2025 16:06
@openshift-ci openshift-ci bot requested review from bitoku and QiWang19 September 8, 2025 16:06
@sohankunkerkar sohankunkerkar force-pushed the fix-podInPlace branch 2 times, most recently from 2bf48c2 to ed7dc8d Compare September 9, 2025 17:18
@sohankunkerkar sohankunkerkar force-pushed the fix-podInPlace branch 2 times, most recently from 24334cc to aba57f1 Compare September 9, 2025 21:14
@sohankunkerkar sohankunkerkar force-pushed the fix-podInPlace branch 5 times, most recently from eb7712a to c424158 Compare September 10, 2025 00:58
This resolves Pod InPlace Resize Container test failure where cpu.weight file
was empty for Guaranteed QoS pods with restartable init containers. Sometimes,
systemd fails to convert CPUShares → CPUWeight for this specific scenario,
likely due to how it handles complex pod hierarchies with concurrent containers,
but the exact internal mechanism is unclear. This acts more as a safeguard in
case systemd doesn’t set the value.

Signed-off-by: Sohan Kunkerkar <sohank2602@gmail.com>
@sohankunkerkar sohankunkerkar changed the title [WIP] OCPBUGS-61220: internal/cgmgr: fix CPU weight setting for cgroup v2 OCPBUGS-61220: internal/cgmgr: fix CPU weight setting for cgroup v2 Sep 10, 2025
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. kind/bug Categorizes issue or PR as related to a bug. kind/flake Categorizes issue or PR as related to a flaky test. release-note Denotes a PR that will be considered when it comes time to generate release notes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants