Jetty version(s)
12.0.31
We are evaluating shifting our spring boot applications to virtual threads. In the process i was going through
VirtualThreadPool doc of which says:
It is possible to specify the max number of concurrent virtual threads that can be spawned, to help limiting resource usage in applications
But after reading the code, it seems like unlimited virtual thread's can be spawned as semaphore is acquired post virtual thread creation. So this essentially mean that as many virtual threads can be created but concurrently only VirtualThreadPool#maxThreads task can run. This behaviour also can also lead to resource exhaustion, while the doc says otherwise. I was expecting a RejectedExecutionException to be thrown if threads more than maxThreads are spawned, hence this looks like a bug to me. Please correct me if i am misunderstanding anything here.