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

Daniel Fuchs dfuchs at openjdk.org
Wed Feb 12 18:31:13 UTC 2025


On Thu, 6 Feb 2025 12:07:57 GMT, David Beaumont <duke at openjdk.org> wrote:

> 8349206: j.u.l.Handler classes create deadlock risk via synchronized publish() method.
> 
> 1. Remove synchronization of calls to publish() in Handlers in java.util.logging package.
> 2. Add explanatory comments to various affected methods.
> 3. Add a test to ensure deadlocks no longer occur.
> 
> Note that this change does not address issue in MemoryHandler (see JDK-8349208).

The code changes look reasonable. WRT to detecting deadlocks a possibility is also to use `ManagementFactory.getThreadMXBean().findDeadlockedThreads();`

See for instance https://github.com/openjdk/jdk/blob/336d0d8592aed734e7b8139e1ecd71d33825c75a/test/jdk/java/util/logging/TestLogConfigurationDeadLock.java#L167

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

PR Review: https://git.openjdk.org/jdk/pull/23491#pullrequestreview-2612856987


More information about the core-libs-dev mailing list