Closed
Description
Describe the bug
I'm using the JVM argument -Dreactor.schedulers.defaultBoundedElasticOnVirtualThreads=true
but, but it doesn't work well with Correto. When specifying this argument, Virtual threads would be the default thread pool.
However, when compiling and running my code using Correto, that doesn't happen. It seems that is the root cause:
META-INF/versions/11/reactor/core/publisher/CallSiteSupplierFactory.class: compiled Java class data, version 55.0 (Java SE 11)
META-INF/versions/21/reactor/core/scheduler/BoundedElasticThreadPerTaskScheduler$BoundedServices.class: compiled Java class data, version 65.0
META-INF/versions/21/reactor/core/scheduler/BoundedElasticThreadPerTaskScheduler$SequentialThreadPerTaskExecutor.class: compiled Java class data, version 65.0
META-INF/versions/21/reactor/core/scheduler/BoundedElasticThreadPerTaskScheduler.class: compiled Java class data, version 65.0
META-INF/versions/21/reactor/core/scheduler/BoundedElasticSchedulerSupplier.class: compiled Java class data, version 65.0
META-INF/versions/21/reactor/core/scheduler/BoundedElasticThreadPerTaskScheduler$SingleThreadExecutorWorker.class: compiled Java class data, version 65.0
META-INF/versions/21/reactor/core/scheduler/BoundedElasticThreadPerTaskScheduler$BoundedServices$ActiveExecutorsState.class: compiled Java class data, version 65.0
META-INF/versions/21/reactor/core/scheduler/BoundedElasticThreadPerTaskScheduler$SchedulerTask.class: compiled Java class data, version 65.0
META-INF/versions/21/reactor/core/scheduler/BoundedElasticThreadPerTaskScheduler$BoundedServices$1.class: compiled Java class data, version 65.0
META-INF/versions/21/reactor/core/scheduler/VirtualThreadFactory.class:
The same code works with other JVM providers.
To Reproduce
Create a small java project using project reactor, compile and run it using this JVM arg -Dreactor.schedulers.defaultBoundedElasticOnVirtualThreads=true.
Use this code:
public static void main(String[] args) throws InterruptedException {
final Mono<String> mono = Mono.just("hello ");
Thread t = new Thread(() -> mono
.map(msg -> msg + "thread ")
.subscribe(v ->
System.out.println(v + Thread.currentThread().getName())
)
);
t.start();
t.join();
}
Expected behavior
See the print of the Virtual thread pool.
Error
2025-03-13 11:38:00 WARN [2025-03-13 10:38:00,844] reactor.core.scheduler.BoundedElasticSchedulerSupplier: Virtual Threads support is not available on the given JVM. Falling back to default BoundedElastic setup
Platform information
OS: Linux backend 6.10.14-linuxkit #1 SMP Mon Feb 24 16:35:16 UTC 2025 aarch64 aarch64 aarch64 GNU/Linux
Version OpenJDK 64-Bit Server VM Corretto-21.0.6.7.1 (build 21.0.6+7-LTS, mixed mode, sharing)
Additional context
Related issue: reactor/reactor-core#4012
Metadata
Metadata
Assignees
Labels
No labels