RFR: 8014218: test/java/util/logging/DrainFindDeadlockTest.java failing intermittently
Daniel Fuchs
daniel.fuchs at oracle.com
Mon Jun 17 14:37:13 UTC 2013
On 6/17/13 4:22 PM, Chris Hegarty wrote:
> On 17/06/2013 14:21, Daniel Fuchs wrote:
>> Hi,
>>
>> Please find below a webrev for fixing
>> 8014218: test/java/util/logging/DrainFindDeadlockTest.java failing
>> intermittently
>>
>> <http://cr.openjdk.java.net/~dfuchs/JDK-8014218/webrev.00/>
>>
>> Without the fix - it's quite easy to make the test fail - especially
>> if you copy paste the @run line a few times.
>>
>> This test is supposed to detect a deadlock in Logger initialization,
>> but it detects too many false positive.
>> An analysis of stack traces that the test dumps when it fails shows
>> that there is actually no deadlock, since one of the two supposed
>> deadlock threads is RUNNABLE.
>>
>> However - this - I think - indicates a bug in
>> ThreadMXBean.findDeadlockedThreads().
>>
>> I have rewritten the test to sanitize the results before
>> and after calling ThreadMXBean.findDeadlockedThreads().
>>
>> Namely - the test will call ThreadMXBean.findDeadlockedThreads()
>> only if the two threads it monitors are simultaneously blocked
>> (obtained by examining ThreadMXBean.getThreadInfo(long[])), and
>> will verify that all threads found in deadlock by
>> ThreadMXBean.findDeadlockedThreads() are indeed blocked.
>>
>> Now - I'm not sure whether this is a good thing or not:
>>
>> pros: it makes it possible to run this test again - and have a greater
>> confidence that if it fails it's because of a genuine deadlock,
>> which is desirable.
>>
>> cons: it 'hides' a possible bug in ThreadMXBean.findDeadlockedThreads()
>> as it appears the test was testing
>> ThreadMXBean.findDeadlockedThreads() more than (or as much
>> as) it was testing the Logger implementation.
>>
>> Does it make sense to push this fix and log a bug against ThreadMXBean?
>> Or should I instead plan to add this test to the problem list
>> (and re-qualify the bug as an issue in ThreadMXBean)?
>
> I'd be ok to simply file a bug against ThreadMXBean, and put the test on
> the ProblemList.txt for now. It should then be revisited with the bug in
> ThreadMXBean.
>
> -Chris.
Thanks Chris. As it turns out there's already a bug for ThreadMXBean.
So I've linked the two together.
best regards,
-- daniel
>
>>
>> guidance appreciated!
>>
>> best regards,
>>
>> -- daniel
>>
>>
More information about the core-libs-dev
mailing list