Hi Nicolas,

I took a quick look that Tomcat's VirtualThreadExecutor does not implement the 
ExecutorService interface, which leads to this result.

So I think this is a Tomcat bug.

Han

> On Dec 8, 2023, at 03:55, Nicolas BONAMY <nicolas.bona...@gmail.com> wrote:
> 
> Hi,
> 
> I try to use virtual thread on Apache Tomcat 10.1.16 with this configuration 
> on macOS or on Linux:
> 
>    <Executor name="tomcatThreadPoolVirtual" 
> class="org.apache.catalina.core.StandardVirtualThreadExecutor"/>
> 
>    <Connector port="8080" 
> protocol="org.apache.coyote.http11.Http11Nio2Protocol"
>               connectionTimeout="20000"
>               redirectPort="8443"
>               maxParameterCount="1000"
>               useVirtualThreads="true"
>               />
> But when I make a request, I'm not on a virtual thread : 
> Thread[#76,Thread-14,5,main] . I profiled my application too but no virtual 
> threads are used.
> 
> If I use a Http11NioProtocol instead of Http11Nio2Protocol, all requests are 
> on virtual thread : 
> VirtualThread[#65,http-nio-8080-virt-0]/runnable@ForkJoinPool-1-worker-1
> 
>    <Executor name="tomcatThreadPoolVirtual" 
> class="org.apache.catalina.core.StandardVirtualThreadExecutor"/>
> 
> 
>    <Connector port="8080" 
> protocol="org.apache.coyote.http11.Http11NioProtocol"
>               connectionTimeout="20000"
>               redirectPort="8443"
>               maxParameterCount="1000"
>               useVirtualThreads="true"
>               />
> Http11Nio2Protocol is not working with virtual threads? Has anyone 
> encountered this problem before?


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to