RFR: 8152515: (logging) LogManager.resetLogger should ignore LinkageError

Daniel Fuchs daniel.fuchs at oracle.com
Fri Oct 28 14:44:03 UTC 2016

On 28/10/16 14:50, Roger Riggs wrote:
> Hi Daniel,
> Looks fine.
> Roger

Thanks Roger.

I have turned the reproducer attached to JDK-8152515 into a
jtreg test. The test creates some logger and registers a handler
that throws LinkageError when closed.

The test passes as expected with the fix.
Without the fix however, it makes jtreg fail in timeout
(which is a bit strange):

[LinkageErrorTest$TestHandler at 3a7f70{closed=false}, 
LinkageErrorTest$TestHandler at 25da7d46{closed=false}, 
LinkageErrorTest$TestHandler at 6c57d74f{closed=true}]
Timeout signalled after 120 seconds
	at LinkageErrorTest$TestHandler.close(LinkageErrorTest.java:63)
java.util.logging.LogManager.closeHandlers(java.logging at 9-internal/LogManager.java:1449)
java.util.logging.LogManager.resetLogger(java.logging at 9-internal/LogManager.java:1459)
java.util.logging.LogManager.resetLoggerContext(java.logging at 9-internal/LogManager.java:1439)
java.util.logging.LogManager.reset(java.logging at 9-internal/LogManager.java:1424)
java.util.logging.LogManager$Cleaner.run(java.logging at 9-internal/LogManager.java:284)
STATUS:Failed.`main' threw exception: java.lang.LinkageError

I am not sure whether I should push this test or not...

What do you think? Is that behavior going to stay stable?
I mean - can we rely on the fact that jtreg will always
fail this test if the fix is not present?

Here is the webrev with the test:

-- daniel

> On 10/28/2016 7:51 AM, Daniel Fuchs wrote:
>> Hi,
>> Please find below a trivial  patch for:
>> 8152515: (logging) LogManager.resetLogger should ignore LinkageError
>> https://bugs.openjdk.java.net/browse/JDK-8152515
>> Patch:
>> http://cr.openjdk.java.net/~dfuchs/webrev_8152515/webrev.00/
>> The issue might occur at shutdown, when a handler that makes uses
>> of some APIs provided by an OSGI bundle which was already closed
>> by the shutdown process is in turn closed by the LogManager.Cleaner
>> thread. In that case some subclasses of LinkageError may be thrown,
>> interrupting the reset process and preventing other handlers from
>> being closed properly.
>> The patch proposes to trivially ignore LinkageError at shutdown while
>> the LogManager.Cleaner thread is running.
>> best regards,
>> -- daniel

More information about the core-libs-dev mailing list