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

8250984: Memory Docker tests fail on some Linux kernels w/o cgroupv1 … #342

Closed
wants to merge 3 commits into from

Conversation

hseigel
Copy link
Member

@hseigel hseigel commented Sep 24, 2020

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

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8250984: Memory Docker tests fail on some Linux kernels w/o cgroupv1 swap limit capabilities ⚠️ Title mismatch between PR and JBS.

Reviewers

Download

$ git fetch https://git.openjdk.java.net/jdk pull/342/head:pull/342
$ git checkout pull/342

@hseigel
Copy link
Member Author

hseigel commented Sep 24, 2020

/label hotspot-runtime

@bridgekeeper
Copy link

bridgekeeper bot commented Sep 24, 2020

👋 Welcome back hseigel! 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.

@hseigel hseigel marked this pull request as ready for review September 24, 2020 18:34
@openjdk openjdk bot added the hotspot-runtime hotspot-runtime-dev@openjdk.org label Sep 24, 2020
@openjdk
Copy link

openjdk bot commented Sep 24, 2020

@hseigel
The hotspot-runtime label was successfully added.

@openjdk openjdk bot added the rfr Pull request is ready for review label Sep 24, 2020
@hseigel
Copy link
Member Author

hseigel commented Sep 24, 2020

This fix was proposed by Bob V.

@mlbridge
Copy link

mlbridge bot commented Sep 24, 2020

Webrevs

@mlbridge
Copy link

mlbridge bot commented Sep 24, 2020

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]+)");
Copy link
Contributor

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?

Copy link
Member Author

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).

Copy link
Contributor

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?

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Member Author

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!

Copy link
Contributor

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.

Copy link
Contributor

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 "-".

Copy link
Contributor

@jerboaa jerboaa left a 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]+");
Copy link
Contributor

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]+");

Copy link
Contributor

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 :)

Copy link
Contributor

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.

Copy link
Contributor

@jerboaa jerboaa left a 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]+");
Copy link
Contributor

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.

@openjdk
Copy link

openjdk bot commented Sep 25, 2020

@hseigel This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for more details.

After integration, the commit message for the final commit will be:

8250984: Memory Docker tests fail on some Linux kernels w/o cgroupv1 …

Reviewed-by: bobv, sgehwolf

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 master branch:

  • a75edc2: 8251188: Update LDAP tests not to use wildcard addresses
  • 1f5a033: 8253555: Make ByteSize and WordSize typed scoped enums
  • f62eefc: 8253469: ARM32 Zero: replace usages of __sync_synchronize() with OrderAccess::fence
  • 1b79326: 8242451: ensure semantics of non-capturing lambdas are preserved independent of execution mode
  • dc1ef58: 8253631: Remove unimplemented CompileBroker methods after JEP-165
  • 27d0a70: 8253633: Remove unimplemented TieredThresholdPolicy::set_carry_if_neccessary
  • e12d94a: 8253594: Remove CollectedHeap::supports_tlab_allocation
  • cfa3f74: 8245527: LDAP Channel Binding support for Java GSS/Kerberos
  • 37b7028: 8240556: Abort concurrent mark after effective eager reclamation of humongous objects
  • dcde95b: 8253586: C2: Clean up unused PhaseIterGVN::init_worklist()
  • ... and 4 more: https://git.openjdk.java.net/jdk/compare/9ac162e896dcb07071c7a2146e8eecbd75115edb...master

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.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Sep 25, 2020
@hseigel
Copy link
Member Author

hseigel commented Sep 25, 2020

/integrate

@openjdk openjdk bot closed this Sep 25, 2020
@openjdk openjdk bot added integrated Pull request has been integrated and removed ready Pull request is ready to be integrated labels Sep 25, 2020
@openjdk
Copy link

openjdk bot commented Sep 25, 2020

@hseigel Since your change was applied there have been 14 commits pushed to the master branch:

  • a75edc2: 8251188: Update LDAP tests not to use wildcard addresses
  • 1f5a033: 8253555: Make ByteSize and WordSize typed scoped enums
  • f62eefc: 8253469: ARM32 Zero: replace usages of __sync_synchronize() with OrderAccess::fence
  • 1b79326: 8242451: ensure semantics of non-capturing lambdas are preserved independent of execution mode
  • dc1ef58: 8253631: Remove unimplemented CompileBroker methods after JEP-165
  • 27d0a70: 8253633: Remove unimplemented TieredThresholdPolicy::set_carry_if_neccessary
  • e12d94a: 8253594: Remove CollectedHeap::supports_tlab_allocation
  • cfa3f74: 8245527: LDAP Channel Binding support for Java GSS/Kerberos
  • 37b7028: 8240556: Abort concurrent mark after effective eager reclamation of humongous objects
  • dcde95b: 8253586: C2: Clean up unused PhaseIterGVN::init_worklist()
  • ... and 4 more: https://git.openjdk.java.net/jdk/compare/9ac162e896dcb07071c7a2146e8eecbd75115edb...master

Your commit was automatically rebased without conflicts.

Pushed as commit 0187567.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@openjdk openjdk bot removed the rfr Pull request is ready for review label Sep 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot-runtime hotspot-runtime-dev@openjdk.org integrated Pull request has been integrated
3 participants