On Thu, 6 Feb 2025 12:07:57 GMT, David Beaumont <d...@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

Reply via email to