RFR: 8312174: missing JVMTI events from vthreads parked during JVMTI attach [v2]
Serguei Spitsyn
sspitsyn at openjdk.org
Fri Sep 8 23:32:42 UTC 2023
On Fri, 8 Sep 2023 03:08:33 GMT, Leonid Mesnik <lmesnik at openjdk.org> wrote:
>> test/hotspot/jtreg/serviceability/jvmti/vthread/VThreadEventTest/VThreadEventTest.java line 136:
>>
>>> 134: ready1.await();
>>> 135: mready.decr();
>>> 136: VirtualMachine vm = VirtualMachine.attach(String.valueOf(ProcessHandle.current().pid()));
>>
>> I think sleep is needed here so threads which should be unmounted have time to unmount before attach.
>
> Would it makes sense also to check that thread state is TIMED_WAITING. It should be set TIMED_WAITING unmounted threads https://docs.oracle.com/en/java/javase/20/docs/api/java.base/java/lang/Thread.State.html#TIMED_WAITING
It is strange that the the tested vthreads in sleep(timeout) have sate WAITING, not TIMED_WAITING.
It can be a bug in the implementation.
I've decided to add a short sleep. Checking states looks a little bit over complicated.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/15467#discussion_r1320422072
More information about the serviceability-dev
mailing list