Experiencing an issue with ScheduledExecutorService alongside VT

Alan Bateman Alan.Bateman at oracle.com
Sun Jul 21 19:56:29 UTC 2024



On 21/07/2024 19:14, Yuval Lombard wrote:
> Hi Alan,
>
> By "So I
> think you are running into a bug.." do you mean on my end? (Hope you 
> do 😅)

I should have been clearer, I meant this is likely a JDK bug in the EA 
build. From the thread I'm 80% certain it's related preemption when 
cancelling the timer after Object.wait(millis).

The only thing that you might want to check is whether something is 
accidentally pooling virtual threads to execute periodic tasks, meaning 
something is calling Executors.newScheduleThreadPool with a thread 
factory that creates virtual threads. It's not the cause of this hang, 
just something that I see in the thread dump.

>
> When scheduling my tasks with platform threads I dont see it is being 
> reproduced, although I must say my current platform threads scheduler 
> is different (quartz scheduler) and does not make use of semaphores 
> (but instead it pools its workers) that is why I suspect my usage of 
> semaphores with VT.
>
> Also when I try to execute the vthread_summary command you suggested I 
> get this error:
> java.lang.IllegalArgumentException: Unknown diagnostic command
Ah right, this jcmd is not in the older EA build so it can't be used 
until you pick up a more recent EA build.

-Alan


More information about the loom-dev mailing list