8298730: Refactor subsystem_file_line_contents and add docs and tests#776
8298730: Refactor subsystem_file_line_contents and add docs and tests#776jmtd wants to merge 5 commits intoopenjdk:masterfrom
Conversation
|
👋 Welcome back jdowland! A progress list of the required criteria for merging this PR into |
|
❗ This change is not yet ready to be integrated. |
|
This backport pull request has now been updated with issue from the original commit. |
eac40a0 to
0207fed
Compare
Backport-of: 500c3c17379fe0a62d42ba31bdcdb584b1823f60
|
@jerboaa FYI! I've not un-drafted this yet because it's not ready for review due to the test failures. I'm working on those (although running tier1 keeps getting OOM killed on my workstation). |
This is a cgroup v1 feature and at this point on its way out. More and more systems these days are cgroups v2. I don't think that's worth doing in the stable maintenance only phase 8u is in. |
|
The jdk_security_infra tests are failing for me locally in |
|
Please merge latest master. Some more jdk_security_infra tests have been problem listed: #775 |
https://github.com/openjdk/jdk8u-dev/pull/776/checks?check_run_id=67917822702 shouldn't all fail, though. |
|
The JDK with this seems to segfault: |
Thanks for looking. Did you reproduce this locally, or find segfault in the GHA logs? I haven't found that. I did find "Error: cannot determine version for JDK", and jtreg returning error code 5, which seems to mean "other fault occurred". I've also not managed to reproduce the problem locally yet, after several attempts, it is building and running fine. I've been using |
https://github.com/jmtd/jdk8u-dev/actions/runs/23535698710/job/68511568754#step:9:26 |
|
My current investigative theory is, this change introduces using |
Revert the file path handling to the prior method. Signed-off-by: Jonathan Dowland <jdowland@redhat.com>
Since we are not calling stringStream from the cgroups code, don't apply the changes to it from 8225225 or 8313083. Signed-off-by: Jonathan Dowland <jdowland@redhat.com>
|
I'm exploring two avenues to fix this. One is to resolve the segfault, which revolves around The original change for 8298730 introduces the first use of |
Signed-off-by: Jonathan Dowland <jdowland@redhat.com>
|
New test failure (timeout) to investigate: |
That's a known intermittent failure on 32 bit x86. |
|
@jmtd Without the gtests please specify what kind of testing you've done to verify the modified patch does what it's supposed to? Thanks! |
|
The tests in test_cgroupSubsystem_linux.cpp are solely unit tests for the parsing in I can observe java's behaviour which indirectly indicates whether or not the function parsed successfully. I started with a copy of my system's real /proc/cgroups and verified the above command properly reported on the cgroup settings. For the tests which specify content that should fail (e.g. file contents For the tests that should pass:
I haven't yet attempted to replicate the testing of "max 10000" and "max 10001" (which are for parsing other cgroups files) nor the individual tests in SubSystemFileLineContentsSingleLine. I attempted to run TestMisc.java (I recall you pointing out that the logs from it in 8u indicated a problem that this backport would fix), however my workstation doesn't enumerate the memory controller in /proc/cgroups (8349988, not yet backported to 8u) so I would need retry this one in a VM with a suitable kernel (the bind-mount trick doesn't work for this test since it needs to be applied within the containers that the test create) The success cases above, and also using this "fake /proc/cgroups" technique to expose the memory controller on my workstation, demonstrate java correctly enumerating the memory and cpu limits. |
|
|
|
/approval request This is a pre-requisite for 8313083 which we want in 8u. It wasn't clean. For 8u, I've dropped some of the original patch: the new gtests, since 8u lacks gtest harness; changes to stringStream; and I reworked the patch to not introduce stringStream into the cgroups code: this avoids a SEGV that we hit and did not resolve. |
Backport as a pre-requisite for 8313083. Not clean:
log_tracesubsystem_file_line_contents, and stick to the existingchar[]codestringStreamhere caused a segfault for reasons so far unknown (but possibly due to differences between stringStream implementation in 8u and 11u+)ostream.hpptoostream.cppsince we aren't usingstringStreamheretest_os_linux_cgroups.cppfrom the patch as there are no gtests in 8uI noticed a context difference in
memory_and_swap_limit_in_bytesfor Cgroups V1, which turns out to be because of 8284950. We might want to consider that for 8u as well.Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk8u-dev.git pull/776/head:pull/776$ git checkout pull/776Update a local copy of the PR:
$ git checkout pull/776$ git pull https://git.openjdk.org/jdk8u-dev.git pull/776/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 776View PR using the GUI difftool:
$ git pr show -t 776Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk8u-dev/pull/776.diff
Using Webrev
Link to Webrev Comment