Skip to content

Commit daf2b3e

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

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
public interface VirtualThreadsConfig {
1414

1515
/**
16-
* Virtual thread name prefix. The name of the virtual thread will be the prefix followed by a unique number.
16+
* Virtual thread names. The name of the virtual thread will be the prefix followed by a unique number.
1717
*/
18-
@WithDefault("quarkus-virtual-thread-")
18+
@WithDefault("quarkus-virtual-thread")
1919
Optional<String> namePrefix();
2020

2121
/**

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)