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
8250984: Memory Docker tests fail on some Linux kernels w/o cgroupv1 … #342
Conversation
…swap limit capabilities
/label hotspot-runtime |
|
@hseigel |
…swap limit capabilities
This fix was proposed by Bob V. |
Webrevs
|
Mailing list message from Bob Vandette on hotspot-runtime-dev: Looks good to me. Bob. |
out.shouldMatch("OperatingSystemMXBean.getTotalSwapSpaceSize: [1-9][0-9]+"); | ||
out.shouldContain("Metrics.getMemoryLimit() == " + expectedMemory); | ||
out.shouldContain("Metrics.getMemoryAndSwapLimit() == -1"); | ||
out.shouldMatch("OperatingSystemMXBean.getTotalSwapSpaceSize: -?([0-9]+)"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the optional -
intentional? My understanding is that it should never be negative, should it not?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The optional - is intential in case UNLIMITED is return (-1).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, but the OperatingSystemMXBean impl falls back to returning the system (host) values if the container limits are unlimited. So the internal Metrics value of -1 for UNLIMITED should never be seen. Has this been actually seen in some tests somewhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
jdk/src/jdk.management/unix/classes/com/sun/management/internal/OperatingSystemImpl.java
Line 63 in a75edc2
if (limit >= 0 && memLimit >= 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The -1 has not been seen. I removed the option '-' from the pattern. Please see the changes in the latest commit. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought we were seeing -1 but perhaps this was a previous result before we decided to change Swap+Memory to report Memory instead of failure. I'm going to rerun the tests with and without swap enabled to verify.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All container tests continue to pass with and without swap enabled after removing the "-".
…swap limit capabilities
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll also run this through testing and will report back.
out.shouldMatch("OperatingSystemMXBean.getTotalSwapSpaceSize: [1-9][0-9]+"); | ||
out.shouldContain("Metrics.getMemoryLimit() == " + expectedMemory); | ||
out.shouldContain("Metrics.getMemoryAndSwapLimit() == -1"); | ||
out.shouldMatch("OperatingSystemMXBean.getTotalSwapSpaceSize: [0-9]+"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably be:
out.shouldMatch("OperatingSystemMXBean\\.getTotalSwapSpaceSize: [0-9]+");
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Heh, it was pre-existing :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't critical for this patch. As an pre-existing issue I won't insist on this. Either way is fine for me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to go with or without the tiny fixup.
out.shouldMatch("OperatingSystemMXBean.getTotalSwapSpaceSize: [1-9][0-9]+"); | ||
out.shouldContain("Metrics.getMemoryLimit() == " + expectedMemory); | ||
out.shouldContain("Metrics.getMemoryAndSwapLimit() == -1"); | ||
out.shouldMatch("OperatingSystemMXBean.getTotalSwapSpaceSize: [0-9]+"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't critical for this patch. As an pre-existing issue I won't insist on this. Either way is fine for me.
@hseigel This change now passes all automated pre-integration checks. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 14 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.
|
/integrate |
@hseigel Since your change was applied there have been 14 commits pushed to the
Your commit was automatically rebased without conflicts. Pushed as commit 0187567. |
Please review this change to fix memory docker tests failures on some Linux kernels w/o cgroupv1 swap limit capabilities. The fix works by detecting that swap limit capabilities are not available and returning non-swap related information. For example, if memory and swap usage is requested, and swap limit capabilities are not available, then only memory usage is returned.
The fix was tested by running container tests on systems with and without swap limit capabilities. Additionally, the changes were regression tested by running tier1 and tier2 tests on Windows, Linux x64, and Mac OS, and running tier3 - tier5 tests on Linux x64.
Progress
Issue
Reviewers
Download
$ git fetch https://git.openjdk.java.net/jdk pull/342/head:pull/342
$ git checkout pull/342