RFR: JDK-8240340: java/lang/management/ThreadMXBean/Locks.java is buggy

serguei.spitsyn at oracle.com serguei.spitsyn at oracle.com
Sat Mar 7 07:17:59 UTC 2020


Hi Alex,

It looks good to me.

Thanks,
Serguei


On 3/4/20 16:30, Alex Menkov wrote:
> Hi all,
>
> please review the fix for
> https://bugs.openjdk.java.net/browse/JDK-8240340
> webrev:
> http://cr.openjdk.java.net/~amenkov/jdk15/ThreadMXBean_Locks_test/webrev/
>
> changes:
> - assertThreadState method: don't re-read thread state throwing 
> exception (as we got weird error like "Thread WaitingThread is at 
> WAITING state but is expected to be in Thread.State = WAITING");
> - added proper test shutdown on error (made all threads "daemon", 
> interrupt waiting thread if CheckerThread throws exception);
> - if CheckerThread detects error, propagate the exception to main thread;
> - fixed LockFreeLogger class - it should work for logging from several 
> threads, but it doesn't. I prefer to simplify it just to keep 
> ConcurrentLinkedQueue<String>.
> LockFreeLogger is also used by ThreadMXBeanStateTest test, but only by 
> a single thread.
>
> --alex



More information about the serviceability-dev mailing list