[jdk17u-dev] RFR: 8276660: Scalability bottleneck in java.security.Provider.getService()
Dan Lutker
dlutker at openjdk.org
Mon Jul 22 16:35:42 UTC 2024
On Mon, 22 Jul 2024 08:12:36 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:
>> Backporting [JDK-8276660](https://bugs.openjdk.org/browse/JDK-8276660) which also fixes a bug in SecureRandom registration that was exposed during testing of https://github.com/corretto/amazon-corretto-crypto-provider. Currently, if you register a new provider then `new SecureRandom` doesn't work right away and only after making some other call like `Cipher.getInstance()` does it return the ACCP provided SecureRandom.
>>
>> Ran all "java/security/Provider/", "jdk/jfr/event/" and tier1 tests locally on Linux x64 and they passed.
>>
>> "[JDK-8254711](https://bugs.openjdk.org/browse/JDK-8254711): Add java.security.Provider.getService JFR Event" makes changes some of the same functioned but was different in 17u than upstream. To get a cleaner backport I reverted it locally, backported [JDK-8276660](https://bugs.openjdk.org/browse/JDK-8276660) and then re-applied 8254711 to get the updated code around the Map changes.
>>
>> Also backporting the followup fixes:
>> 8292739: Invalid legacy entries may be returned by Provider.getServic…
>> 8279222: Incorrect legacyMap.get in java.security.Provider after JDK-8276660
>
> src/java.base/share/classes/java/security/Provider.java line 1290:
>
>> 1288: s = legacyMap.get(key);
>> 1289: if (s != null && !s.isValid()) {
>> 1290: legacyMap.remove(key, s);
>
> This hunk seems to be different from the hunk in the original changeset: https://github.com/openjdk/jdk/commit/9b747491de01fd011b09668a67113e80c2b7c708#diff-c2847a8d1997d3d28a13354b05d5e21ac6656e7e17f849bc198715099b9b5bd2L1204-R1286 -- and the follow-ups did not change it as well. Does this stack of patches contain some other patch?
This block comes from the JFR patch I reverted and re-applied: [https://github.com/openjdk/jdk/commit/bc2af47e1e4e6e96020e03a60ce098ddd17f63ba#diff-c2847a8d1997d3d28a13354b05d5[…]f849bc198715099b9b5bd2R1286-R1290](https://github.com/openjdk/jdk/commit/bc2af47e1e4e6e96020e03a60ce098ddd17f63ba#diff-c2847a8d1997d3d28a13354b05d5e21ac6656e7e17f849bc198715099b9b5bd2R1286-R1290)
The code should be matching tip minus change changes from https://github.com/openjdk/jdk/commit/17695962ac191b1c0404f9671f09e0e9bbc83ef5#diff-c2847a8d1997d3d28a13354b05d5e21ac6656e7e17f849bc198715099b9b5bd2R1273-R1274
-------------
PR Review Comment: https://git.openjdk.org/jdk17u-dev/pull/2730#discussion_r1686800177
More information about the jdk-updates-dev
mailing list