Skip to content

Commit fb2d5ea

Browse files
committed
Stop using named (with counter) VT names due to https://bugs.openjdk.org/browse/JDK-8372410
1 parent 9d794a5 commit fb2d5ea

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

extensions/virtual-threads/runtime/src/main/java/io/quarkus/virtual/threads/VirtualThreadsRecorder.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,10 @@ static ExecutorService newVirtualThreadPerTaskExecutorWithName(String prefix)
117117
Class<?> vtbClass = Class.forName("java.lang.Thread$Builder$OfVirtual");
118118
// .name()
119119
if (prefix != null) {
120-
Method name = vtbClass.getMethod("name", String.class, long.class);
121-
vtb = name.invoke(vtb, prefix, 0);
120+
// why this is not using name(prefix, 0)?
121+
// see https://bugs.openjdk.org/browse/JDK-8372410
122+
Method name = vtbClass.getMethod("name", String.class);
123+
vtb = name.invoke(vtb, prefix);
122124
}
123125
// .uncaughtExceptionHandler()
124126
Method uncaughtHandler = vtbClass.getMethod("uncaughtExceptionHandler", Thread.UncaughtExceptionHandler.class);

0 commit comments

Comments
 (0)