Virtual thread hang and all threads stop running on JDK21

Alan Bateman Alan.Bateman at oracle.com
Tue Jun 4 13:45:23 UTC 2024


On 04/06/2024 14:29, 何品(虎鸣) wrote:
>
> Hi, we are using Virtual threads on JDK21.0.2, and find it can stop 
> running, all threads stopped/hung, and we can't even call thread dump.
> We try to separate the Virtual Thread's scheduler with reflections. 
> but that does not work too.
>
> Our userbase are pretty simple:
> A: VT Executor backing by 128-sized ThreadPoolExecutor for running 
> java code with `CompletableFuture.get`
> B: VT Executor backing by 64-sized ThreadPoolExecutor for retrieving 
> data with HTTP client, with max concurrency to 3000 (virtual threads)
>
> Even if A and B are using Different backing ThreadPool, they all stop 
> responding。
>
There isn't much to go on here. There isn't any support at this time for 
custom schedulers so I can't tell if the hang is when you use the 
default scheduler or only when you use reflection to hack in and set 
your own?

Also when you say "thread dump", do you mean the HotSpot VM thread dump 
(ctrl-\, jstack, jcmd Thread.print) or do you mean the thread dump that 
prints all virtual threads (jcmd Thread.dump_to_file)?

-Alan

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/loom-dev/attachments/20240604/1faf603d/attachment-0001.htm>


More information about the loom-dev mailing list