Avoid thread pinning in SseEmitter write operations #30996
Labels
in: web
Issues in web modules (web, webmvc, webflux, websocket)
type: enhancement
A general enhancement
Milestone
SseEmitter
is guarding write operations to the response with asynchronized
block. As explained in JEP 245, this behavior can cause the current virtual thread to be pinned to the underlying platform thread during the write operation.We should use instead a
ReentrantLock
to prevent platform thread pinning on JDK 21 (if virtual threads are enabled).The text was updated successfully, but these errors were encountered: