RFR for JDK-6772009 Intermittent test failure: java/util/concurrent/locks/ReentrantLock/CancelledLockLoops.java test failed with 'Completed != 2'

srikalyan chandrashekar srikalyan.chandrashekar at oracle.com
Tue Nov 19 06:12:58 UTC 2013


Hi all, I am working on bug JDK-6772009 
<https://bugs.openjdk.java.net/browse/JDK-6772009> .

Root Cause:
The timeout value gives too much grace period on faster machines on 
which the "TO BE INTERRUPTED" threads complete faster before being 
interrupted at right time.

Suggested Fix:
a) Decrease the timeout from 100 to 50ms which will ensure that the test 
will pass even on faster machines , and ensures the threads will be 
canceled when running and anyways there is a Barrier to ensure the test 
threads all complete gracefully.
Miscellaneous fixes
b) Convert result from int to long(possible integer overflow otherwise)
c) Catch BrokenBarrierException in more granular fashion in 
ReentrantLockLoop to update and print the results (which will be missed 
otherwise)
Add more diagnostics
d) Assign names to threads
e) Print which threads update the 'completed' variable.

I have attached the webrev for convenience as the changes are 
interleaved and is best viewed as sdiff.
Please let me know if you have any comments or suggestions.



Thank you

-- 

--
Thanks
kalyan



More information about the core-libs-dev mailing list