jdk17u-dev icon indicating copy to clipboard operation
jdk17u-dev copied to clipboard

8324648: Avoid NoSuchMethodError when instantiating NativePRNG

Open olivergillespie opened this issue 1 year ago • 9 comments
trafficstars

Hi all,

This pull request contains a backport of commit 69b2674c from the openjdk/jdk repository.

The commit being backported was authored by Oli Gillespie on 9 Feb 2024 and was reviewed by Aleksey Shipilev, Weijun Wang, Chen Liang and Valerie Peng.

I had to manually resolve the copyright change, but apart from that it's clean.

Benchmark results (make test TEST=micro:org.openjdk.bench.java.security.SecureRandomBench, using the benchmark from https://github.com/openjdk/jdk/pull/17559):

Before: 2614 ± 127  ns/op
 After:  508 ± 7 ns/op

Thanks!


Progress

  • [x] Change must not contain extraneous whitespace
  • [x] Commit message must refer to an issue
  • [ ] JDK-8324648 needs maintainer approval

Issue

  • JDK-8324648: Avoid NoSuchMethodError when instantiating NativePRNG (Enhancement - P4)

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 2308

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

Using diff file

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

Webrev

Link to Webrev Comment

olivergillespie avatar Mar 19 '24 14:03 olivergillespie

:wave: Welcome back ogillespie! 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.

bridgekeeper[bot] avatar Mar 19 '24 14:03 bridgekeeper[bot]

@olivergillespie 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 details.

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

8324648: Avoid NoSuchMethodError when instantiating NativePRNG

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 8 new commits pushed to the master branch:

  • 44ade1dba7503421bb4b3515e3ccd9c899fafe8d: 8315804: Open source several Swing JTabbedPane JTextArea JTextField tests
  • 0fa4d917e066f8506e85d47479ab5ae723bd722c: 8310201: Reduce verbose locale output in -XshowSettings launcher option
  • 95432a6576c8f39e7e208168a45c214d7ed5148e: 8322008: Exclude some CDS tests from running with -Xshare:off
  • 9c89f1cd3a2b9b0f5c1eec58e4ee04b2bedd6ac8: 8320945: problemlist tests failing on latest Windows 11 update
  • 09ad130fd4f40278e8b228853c9a4b662521c01d: 8329134: Reconsider TLAB zapping
  • 33ab474c65d35570b91bf9821a44f9c6d0345220: 8311666: Disabled tests in test/jdk/sun/java2d/marlin
  • 1b807f914a8ee5030d35ebc69edc5429cac0c44d: 8315559: Delay TempSymbol cleanup to avoid symbol table churn
  • 1ce0c63577a9480f162e762fd8a1db344955d5a7: 8324646: Avoid Class.forName in SecureRandom constructor

Please see this link for an up-to-date comparison between the source branch of this pull request and the master branch. 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.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

openjdk[bot] avatar Mar 19 '24 14:03 openjdk[bot]

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

openjdk[bot] avatar Mar 19 '24 14:03 openjdk[bot]

⚠️ @olivergillespie 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.

openjdk[bot] avatar Mar 19 '24 14:03 openjdk[bot]

Webrevs

mlbridge[bot] avatar Mar 19 '24 14:03 mlbridge[bot]

/approval request Performance improvement in SecureRandom., which I have seen on the hot path in real applications. Clean backport, low risk in my opinion (simple change to only one file). It has been in tip for over 4 weeks. Confirmed the benchmark results match tip (saves ~2100ns in SecureRandom constructor).

Note: GHA riscv64 cross-compile failing, unrelated to this change, seen in all other recent PRs.

olivergillespie avatar Mar 19 '24 17:03 olivergillespie

@olivergillespie 8324648: The approval request has been created successfully.

openjdk[bot] avatar Mar 19 '24 17:03 openjdk[bot]

@olivergillespie This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

bridgekeeper[bot] avatar May 01 '24 10:05 bridgekeeper[bot]

Waiting for next release for approval as requested.

olivergillespie avatar May 02 '24 09:05 olivergillespie

@olivergillespie This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

bridgekeeper[bot] avatar May 30 '24 11:05 bridgekeeper[bot]

/integrate

olivergillespie avatar Jun 04 '24 08:06 olivergillespie

@olivergillespie Your change (at version 410f39c57250636e2c5131b296e1f642e08c42b1) is now ready to be sponsored by a Committer.

openjdk[bot] avatar Jun 04 '24 08:06 openjdk[bot]

/sponsor

shipilev avatar Jun 04 '24 08:06 shipilev

Going to push as commit b275236fc5b50890ffc7c0470f017913489d3193. Since your change was applied there have been 8 commits pushed to the master branch:

  • 44ade1dba7503421bb4b3515e3ccd9c899fafe8d: 8315804: Open source several Swing JTabbedPane JTextArea JTextField tests
  • 0fa4d917e066f8506e85d47479ab5ae723bd722c: 8310201: Reduce verbose locale output in -XshowSettings launcher option
  • 95432a6576c8f39e7e208168a45c214d7ed5148e: 8322008: Exclude some CDS tests from running with -Xshare:off
  • 9c89f1cd3a2b9b0f5c1eec58e4ee04b2bedd6ac8: 8320945: problemlist tests failing on latest Windows 11 update
  • 09ad130fd4f40278e8b228853c9a4b662521c01d: 8329134: Reconsider TLAB zapping
  • 33ab474c65d35570b91bf9821a44f9c6d0345220: 8311666: Disabled tests in test/jdk/sun/java2d/marlin
  • 1b807f914a8ee5030d35ebc69edc5429cac0c44d: 8315559: Delay TempSymbol cleanup to avoid symbol table churn
  • 1ce0c63577a9480f162e762fd8a1db344955d5a7: 8324646: Avoid Class.forName in SecureRandom constructor

Your commit was automatically rebased without conflicts.

openjdk[bot] avatar Jun 04 '24 08:06 openjdk[bot]

@shipilev @olivergillespie Pushed as commit b275236fc5b50890ffc7c0470f017913489d3193.

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

openjdk[bot] avatar Jun 04 '24 08:06 openjdk[bot]