Jetty support uses a thread in org.springframework.boot.web.embedded.jetty.GracefulShutdown#awaitShutdown to wait until there are no more active requests. This could be a virtual thread.

Netty support uses a thread in org.springframework.boot.web.embedded.netty.GracefulShutdown#doShutdown to call DisposableServer.disposeNow. This is implemented by calling .block() on a Mono and I think this should be safe in a virtual thread.

Tomcat support uses a thread in org.springframework.boot.web.embedded.tomcat.GracefulShutdown#doShutdown to close all connectors and then check in a loop with a sleep inside if all requests have been handled. We could move the connector closing outside the thread and then use the thread to only await until there are no more connections (like the Jetty code does it). Then this thread could be a virtual thread.

Comment From: mhalbritter

Those threads are only started when the server is shut down. I don't think we gain much here when switching them to virtual threads.