RfR - 8132550: java/util/logging/LoggingDeadlock2.java times out
daniel.fuchs at oracle.com
Fri Jul 31 10:48:16 UTC 2015
Please find below a fix for:
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:
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.
More information about the core-libs-dev