RFR: 8370887: DelayScheduler.replace method may break the 4-ary heap in certain scenarios
Alan Bateman
alanb at openjdk.org
Mon Nov 24 14:36:30 UTC 2025
On Sun, 23 Nov 2025 09:56:57 GMT, Viktor Klang <vklang at openjdk.org> wrote:
>> DelayScheduler.replace missing check to sift up when replaced with smaller value. checkHeap checks invariants when replacing. Executing tests with make run-test or other targets runs tests with -esa so assume is enabled.
>>
>> New regression test to ensure delayed tests executes in expected delay order.
>
> src/java.base/share/classes/java/util/concurrent/DelayScheduler.java line 401:
>
>> 399: }
>> 400: }
>> 401: assert checkHeap(h, n);
>
> It's great to have this run during debug builds 👍
The tests runs are done with -esa so the assert is always enabled in test runs. So all good.
> test/jdk/java/util/concurrent/DelayScheduler/AscendingOrderAfterReplace.java line 45:
>
>> 43: .mapToObj(i -> Integer.valueOf(i).toString())
>> 44: .collect(Collectors.joining(", "));
>> 45: System.out.println("Delays: " + delays);
>
> I presume this is to be removed.
The trace messages are there to help diagnose in the event of a failure.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/28469#discussion_r2554800800
PR Review Comment: https://git.openjdk.org/jdk/pull/28469#discussion_r2554797410
More information about the core-libs-dev
mailing list