On Fri, 24 Apr 2026 18:34:55 GMT, Chris Plummer <[email protected]> wrote:

>> SendaoYan has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   1. Fix the comments about the senond attemt trigger finalize(); 2. 
>> Replaced finalizerRun as FINALIZER_DONE.getCount()
>
> test/jdk/com/sun/jdi/FinalizerTest.java line 84:
> 
>> 82:             // finalize() run in another lower priority Finalizer thread,
>> 83:             // wait for it to finish
>> 84:             finalizerDone.await(5, TimeUnit.SECONDS);
> 
> Have you tested to make sure there are cases where this does time out and we 
> enter the code below? it might be worth doing some testing with the gc() and 
> runFinalization() code above disabled to make sure the code below is working 
> properly.

The failure log in the JBS issue shows that, before this PR, there are a little 
probability enter the code below(second attempt to trigger finalization). So 
this PR add countdownlatch to wait the finalize() run finish.

And if I comment out the first gc()/runFinalization() and run this test, it 
will enter the code below also. I test below code 200 times by comment out the 
first gc()/runFinalization(), test all passed.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/30829#discussion_r3141450087

Reply via email to