Skip to content

Avoid thread pinning in SseEmitter write operations #30996

Closed
@bclozel

Description

@bclozel
Member

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).

Activity

added
in: webIssues in web modules (web, webmvc, webflux, websocket)
on Aug 4, 2023
added this to the 6.1.0-M4 milestone on Aug 4, 2023
self-assigned this
on Aug 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

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

Type

No type

Projects

No projects

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @bclozel

      Issue actions

        Avoid thread pinning in SseEmitter write operations · Issue #30996 · spring-projects/spring-framework