<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
On 04/06/2024 14:29, 何品(虎鸣) wrote:<br>
<blockquote type="cite" cite="mid:c0fb7f63-9815-4d6e-930f-425a8795c131.hepin.p@alibaba-inc.com">
<div class="__aliyun_email_body_block">
<div style="line-height:1.7;font-family:Tahoma,Arial,STHeiti,SimSun;font-size:14.0px;color:#000000;">
<div style="clear:both;"><br>
</div>
<div style="clear:both;">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.</div>
<div style="clear:both;">We try to separate the Virtual
Thread's scheduler with reflections. but that does not work
too.</div>
<div style="clear:both;"><br>
</div>
<div style="clear:both;">Our userbase are pretty simple:</div>
<div style="clear:both;">A: VT Executor backing by 128-sized
ThreadPoolExecutor for running java code with
`CompletableFuture.get`</div>
<div style="clear:both;">B: VT Executor backing by 64-sized
ThreadPoolExecutor for retrieving data with HTTP client,
with max concurrency to 3000 (virtual threads)</div>
<div style="clear:both;"><br>
</div>
<div style="clear:both;">Even if A and B are using Different
backing ThreadPool, they all stop responding。</div>
<br>
</div>
</div>
</blockquote>
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?<br>
<br>
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)?<br>
<br>
-Alan<br>
<br>
<br>
</body>
</html>