[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-serviceability-dev
Subject:    Re: [PING] Re: RFR 8129976: RunFinalizationTest.java times out frequently
From:       "serguei.spitsyn () oracle ! com" <serguei ! spitsyn () oracle ! com>
Date:       2015-07-31 12:56:49
Message-ID: 55BB7091.1060001 () oracle ! com
[Download RAW message or body]

The fix looks good to me.
Nice that it does not fail in 1000 runs.

Thanks,
Serguei

On 7/31/15 4:55 AM, Jaroslav Bachorik wrote:
> Could someone, please, take a look at this?
>
> Thanks,
>
> -JB-
>
> On 9.7.2015 18:45, Jaroslav Bachorik wrote:
>> Please, review the following test change
>>
>> Issue : https://bugs.openjdk.java.net/browse/JDK-8129976
>> Webrev: http://cr.openjdk.java.net/~jbachorik/8129976/webrev.00
>>
>> The test, as it is now, most of the times does not test the desired
>> functionality (that invoking GC.run_finalization DCMD actually runs
>> finalization) because the preceding call to System.gc() will finalize
>> the test object sooner. But without calling System.gc() it is non
>> predictable when the test object will be eligible for finalization so we
>> have to call System.gc().
>>
>> In the rare occasions when System.gc() induced finalization does not
>> finish before invoking GC.run_finalization the test deadlocks because
>> its locking logic is flawed.
>>
>> In order to make this test work I had to:
>> a\ Switch from '@run testng' to '@run main/othervm'
>> b\ Run the finalization testing code in shutdown handler - this seems to
>> prevent the finalization happening prematurely after calling System.gc()
>> while still making the test object eligible for finalization
>> c\ Switch from ReentrantLock to a Phaser for synchronization
>> d\ Make sure that the finalization is not carried out on the default
>> "Finalizer" thread to rule out finalization due to System.gc()
>>
>> After these changes the test seems to be rather stable (ran 1000
>> iterations in a tight loop without single failure).
>>
>> Thanks,
>>
>> -JB-
>

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic