Skip to content

Conversation

lingjun-cg
Copy link
Contributor

@lingjun-cg lingjun-cg commented Aug 20, 2025

Backport JDK-8343191 for fixing NPE when run with cgroupv1 on some older linux kernel(3.10). Application throw NPE when startup, and also cannot get correct cpu count in contianer.
The PR includes all test bug fix in these issues "JDK-8351382,JDK-8352926,JDK-8354475,JDK-8360533".


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • JDK-8343191 needs maintainer approval

Issue

  • JDK-8343191: Cgroup v1 subsystem fails to set subsystem path (Bug - P3 - Requested)

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk21u-dev.git pull/2109/head:pull/2109
$ git checkout pull/2109

Update a local copy of the PR:
$ git checkout pull/2109
$ git pull https://git.openjdk.org/jdk21u-dev.git pull/2109/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 2109

View PR using the GUI difftool:
$ git pr show -t 2109

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk21u-dev/pull/2109.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Aug 20, 2025

👋 Welcome back lingjun-cg! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Aug 20, 2025

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk openjdk bot added the rfr Pull request is ready for review label Aug 20, 2025
@openjdk
Copy link

openjdk bot commented Aug 20, 2025

@lingjun-cg
8343191: The approval request has been created successfully.

@openjdk openjdk bot added the approval Requires approval; will be removed when approval is received label Aug 20, 2025
@mlbridge
Copy link

mlbridge bot commented Aug 20, 2025

Webrevs

@jerboaa
Copy link
Contributor

jerboaa commented Aug 20, 2025

@lingjun-cg This isn't being recognized as a backport. That usually happens by using the correct PR title: Backport <sha-of-the-original-change>. Please fix that.

@jerboaa
Copy link
Contributor

jerboaa commented Aug 20, 2025

Also the Fix request comment is insufficient. Please read: https://openjdk.org/projects/jdk-updates/approval.html

@openjdk openjdk bot removed the approval Requires approval; will be removed when approval is received label Aug 20, 2025
@lingjun-cg lingjun-cg changed the title 8343191: Cgroup v1 subsystem fails to set subsystem path Backport de29ef3bf3a029f99f340de9f093cd20544217fd Aug 20, 2025
@openjdk openjdk bot changed the title Backport de29ef3bf3a029f99f340de9f093cd20544217fd 8343191: Cgroup v1 subsystem fails to set subsystem path Aug 20, 2025
@openjdk
Copy link

openjdk bot commented Aug 20, 2025

This backport pull request has now been updated with issue from the original commit.

@openjdk openjdk bot added backport Port of a pull request already in a different code base clean Identical backport; no merge resolution required labels Aug 20, 2025
@openjdk
Copy link

openjdk bot commented Aug 20, 2025

⚠️ @lingjun-cg This change is now ready for you to apply for maintainer approval. This can be done directly in each associated issue or by using the /approval command.

@lingjun-cg
Copy link
Contributor Author

/approval request Fix request [21u]

I backport this for fix NPE when jdk.internal.platform.CgroupMetrics initializing and cannot get cpu count correctly with cgroupv1 on linux kernel 3.10
Clean backport.
Test passed.
risk is low.

@openjdk
Copy link

openjdk bot commented Aug 20, 2025

@lingjun-cg
8343191: The approval request has been updated successfully.

@openjdk openjdk bot added the approval Requires approval; will be removed when approval is received label Aug 20, 2025
@lingjun-cg
Copy link
Contributor Author

lingjun-cg commented Aug 20, 2025

@lingjun-cg This isn't being recognized as a backport. That usually happens by using the correct PR title: Backport <sha-of-the-original-change>. Please fix that.

thanks. done

@lingjun-cg
Copy link
Contributor Author

Also the Fix request comment is insufficient. Please read: https://openjdk.org/projects/jdk-updates/approval.html

updated

@jerboaa
Copy link
Contributor

jerboaa commented Aug 21, 2025

There are follow-ups for this to prepare. Please prepare dependent PRs for those: JDK-8352926, JDK-8360533, JDK-8354475, JDK-8351382

@openjdk openjdk bot removed the clean Identical backport; no merge resolution required label Aug 22, 2025
@lingjun-cg
Copy link
Contributor Author

lingjun-cg commented Aug 22, 2025

There are follow-ups for this to prepare. Please prepare dependent PRs for those: JDK-8352926, JDK-8360533, JDK-8354475, JDK-8351382

Thanks for your review. Because the JDK-8352926, JDK-8360533, JDK-8354475, JDK-8351382 depends on current JDK-8343191, and the 4 JBS issues have dependency on each other, so I merge all of them into the current PR.
I'm not sure is it OK? If not, maybe need create 5 PRs one by one according the dependency between PRs.
If that, please review the first current PR, then I create others.

Also there has a test failed: tools/javac/patterns/SOEDeeplyNestedBlocksTest.java
But it has nothing to do with current PR.

@GoeLin
Copy link
Member

GoeLin commented Aug 22, 2025

Hi @lingjun-cg
for the follow-ups:
I ran this PR through our testing. It makes jdk/internal/platform/docker/TestDockerMemoryMetricsSubgroup.java fail.
You can not push it this way.

Yes, it's not nice to merge 5 changes into one, especially if the changes backport clean. The merged change will require a review, and that review will be unnecessary complex.

If the follow up is a very simple change, and a bad bug like one that kills the build, you should include it right away.
If the follow-up is urgent, like the one that probably fixes TestDockerMemoryMetricsSubgroup, make a dependent pull request so that you can push them right after each other.
To do so check out origin/pr/2109 and place the backport on top of that.

For other follow-ups, 1. inform in your approval comment that they are needed, and 2. backport them in a timely manner. Don't let us approvers discover such a situation!!

Also, you need to test your backports much more thoroughly, you should have caught the problem with TestDockerMemoryMetricsSubgroup.java yourself.
--> search for & run all tests that affect the component your backport touches.
--> run at least tier 2 & 3
--> Run some larger applications or something other than the jtreg tests

@lingjun-cg lingjun-cg closed this Aug 22, 2025
@sercher
Copy link
Contributor

sercher commented Sep 25, 2025

Hi @lingjun-cg
Are you going to re-submit the PR?

@lingjun-cg
Copy link
Contributor Author

Hi @lingjun-cg Are you going to re-submit the PR?

Hi @sercher
I want to re-submit, but I cannot do that because it take a long time. Clean backport of JDK-8343191 that requires backport these issues "JDK-8360533 JDK-8354475 JDK-8352926 JDK-8351382 JDK-8322420 JDK-8339148 JDK-8331560 JDK-8261242 JDK-8333326 JDK-8333200 JDK-8302744 JDK-8327946 JDK-8325139 JDK-8324287 JDK-8313083" also.
If submit PRs for all issues one by one, it take a long time. So I choose merge commits into one PR in our forked repository.

@sercher
Copy link
Contributor

sercher commented Sep 27, 2025

@lingjun-cg Have you submitted any of the dependencies yet?

Clean backport of JDK-8343191 that requires backport these issues "JDK-8360533 JDK-8354475 JDK-8352926 JDK-8351382 JDK-8322420 JDK-8339148 JDK-8331560 JDK-8261242 JDK-8333326 JDK-8333200 JDK-8302744 JDK-8327946 JDK-8325139 JDK-8324287 JDK-8313083"

Where is this list from? Are you backporting to JDK 21? Let me help you with this.

@lingjun-cg
Copy link
Contributor Author

lingjun-cg commented Sep 28, 2025

@sercher Not yet;
The list is from the experience when I backport to a downstream repository of jdk21. The list is not completely right when backport to jdk21, because some has backported.
I'd like to backport to JDK 21, but one by one is too time-consuming. There are two options that can reduce the PR number, Could you give me some suggestions about how to submit the PRs?

  1. If clean backport is not mandatory. Some commits no need to backport
  2. Split the 16 commits into 3 PRs:
    The first PR is about JFR.

8327946: containers/docker/TestJFREvents.java fails when host kernel config vm.swappiness=0 after JDK-8325139
8325139: JFR SwapSpace event - add free swap space information on Linux when running in a container environment
8324287: Record total and free swap space in JFR
8313083: Print 'rss' and 'cache' as part of the container information

The second PR is about container code refactor.

8322420: [Linux] cgroup v2: Limits in parent nested control groups are not detected
8339148: Make os::Linux::active_processor_count() public
8331560: Refactor Hotspot container detection code so that subsystem delegates to controllers
8261242: [Linux] OSContainer::is_containerized() returns true when run outside a container
8333326: Linux Alpine build fails after 8302744
8333200: Test containers/docker/TestPids.java fails Limit value -1 is not accepted as unlimited
8302744: Refactor Hotspot container detection code

The third PR is about fix the bug "Cgroup v1 subsystem fails to set subsystem path"

8360533: ContainerRuntimeVersionTestUtils fromVersionString fails with some docker versions
8354475: TestDockerMemoryMetricsSubgroup.java fails with exitValue = 1
8352926: New test TestDockerMemoryMetricsSubgroup.java fails
8351382: New test containers/docker/TestMemoryWithSubgroups.java is failing
8343191: Cgroup v1 subsystem fails to set subsystem path

@sercher
Copy link
Contributor

sercher commented Sep 28, 2025

This is unrelated to OpenJDK 21 effort. The current JDK-8343191 is backporting cleanly and all follow ups are clean. Let me sumbit the follow ups as dependent PRs as suggested by Götz and Severin. Once it's integrated you will take your time fixing the downsteam repository.

@sercher
Copy link
Contributor

sercher commented Sep 29, 2025

new PRs: #2278, #2279, #2280, #2282

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

Labels

approval Requires approval; will be removed when approval is received backport Port of a pull request already in a different code base rfr Pull request is ready for review

Development

Successfully merging this pull request may close these issues.

4 participants