RfR - 8132550: java/util/logging/LoggingDeadlock2.java times out

huizhe wang huizhe.wang at oracle.com
Fri Jul 31 17:09:28 UTC 2015


Looks good to me, Daniel.

-Joe

On 7/31/2015 3:48 AM, Daniel Fuchs wrote:
> Hi,
>
> Please find below a fix for:
>
> https://bugs.openjdk.java.net/browse/JDK-8132550
> 8132550: java/util/logging/LoggingDeadlock2.java times out
>
> I was able to reproduce the deadlock consistently by inserting
> some Thread.sleep() statements at the critical places.
> The webrev still shows that (as commented code) - but I will remove
> those comments before pushing:
>
> http://cr.openjdk.java.net/~dfuchs/webrev_8132550/webrev.00/
>
> This issue here is that LogManager should also use the
> configurationLock when reading its primordial configuration
> (and not a simple synchronized(this)).
>
> That should remove all uses of synchronized((LogManager)this) from 
> LogManager, and ensure that reset(), readConfiguration(), and 
> ensureLogManagerInitialized() all use the same lock.
>
> When we moved to using a ReantrantLock object for configuration I had
> already considered doing this - but at the time I deemed it unnecessary,
> thinking you couldn't obtain a reference on LogManager through
> getLogManager() before it had initialized. But this was counting
> without System.exit() being called and starting the Cleaner thread 
> before the first call to LogManager.getLogManager() had finished.
> This introduced a small time window in which the deadlock became
> possible - at exit time, if something happened to initialize the
> LogManager right at that time.
>
> best regards
>
> -- daniel




More information about the core-libs-dev mailing list