Skip to content

Avoid thread pinning in SseEmitter write operations #30996

@bclozel

Description

@bclozel

SseEmitter is guarding write operations to the response with a synchronized 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).

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions