[crac] RFR: 8357984: [CRaC] Improve new properties installation code

Timofei Pushkin tpushkin at openjdk.org
Thu May 29 07:40:11 UTC 2025


On Thu, 29 May 2025 06:33:38 GMT, Radim Vansa <rvansa at openjdk.org> wrote:

>> Rewrites the code which installs new properties on restore to make it more concise by using direct array iteration and lambdas.
>> 
>> Note that initially the lambdas were removed from this code in #75 because they triggered a resource registration in a blocking context during C/R which led to a deadlock. But as I understand #73 made it possible to use lambdas during C/R.
>> 
>> I also noted that there are no tests for new properties so I added one.
>
> src/java.base/share/classes/jdk/internal/crac/mirror/Core.java line 198:
> 
>> 196:             for (var prop : newProperties) {
>> 197:                 String[] pair = prop.split("=", 2);
>> 198:                 AccessController.doPrivileged((PrivilegedAction<Void>) () -> {
> 
> With SecurityManager obsoleted, we don't have to use `AccessController.doPrivileged` at all, do we?

Actually yes, I'll remove it. But it is so because of its deletion in JDK 24 and not because of its obsoletion in JDK 17: between 17 and 24 it can still be enabled so we'll have to bring `doPrivileged` back when backporting.

-------------

PR Review Comment: https://git.openjdk.org/crac/pull/233#discussion_r2113397270


More information about the crac-dev mailing list