RFR: 8349206: j.u.l.Handler classes create deadlock risk via synchronized publish() method

David Beaumont duke at openjdk.org
Thu Feb 13 17:20:13 UTC 2025


On Thu, 13 Feb 2025 09:36:08 GMT, David Beaumont <duke at openjdk.org> wrote:

>> test/jdk/java/util/logging/LoggingDeadlock5.java line 115:
>> 
>>> 113: 
>>> 114:     private static class DeadLocker {
>>> 115:         private final static Duration JOIN_WAIT = Duration.ofMillis(500);
>> 
>> You might want to use `jdk.test.lib.Utils.adjustTimeout()` here to account for the case when the test is run on slower configurations. Typically in higher tiers, this test might be run with -Xcomp or -Xint and on debug builds which might cause slow downs and cause the join() method to exit too early - reporting false positives.
>
> None of the other logging deadlock tests use this mechanism, but thanks for pointing it out. I will investigate.

After discussing it, I think I'll wait before complicating the code or increasing timeouts (since the timeout should only be used in the self-test case anyway, as we're testing primarily for the *lack* of deadlocks).

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23491#discussion_r1954914913


More information about the core-libs-dev mailing list