On Thu, 30 Apr 2026 20:31:10 GMT, Naoto Sato <[email protected]> wrote:

>> Fixing the race condition during the initialization of the skeleton map. The 
>> root cause was that the map could be accessed while it was still being 
>> initialized, leading to an NPE. Although the NPE could be avoided by 
>> returning a default value, the map initialization itself should be made 
>> thread safe.
>> 
>> ---------
>> - [x] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> Naoto Sato has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Removed unnecessary throws

test/jdk/sun/util/locale/provider/SkeletonRaceTest.java line 75:

> 73:         go.countDown();
> 74:         pool.shutdown();
> 75:         for (Future<?> f : futures) f.get();

Use try-with-resources on the pool (close waits for tasks to finish) so that 
any exception thrown does not preclude the pool from cleaning up.

Another alternative is to use Virtual Threads instead, so that the cost of 
creating 50 platform threads is mitigated, and instead run several passes to 
attempt to provoke the race condition.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/31006#discussion_r3173200072

Reply via email to