Skip to content

Avoid pinning in SSEEmitter & ResponseBodyEmitter #35422

@acktsap

Description

@acktsap

#30996 fixed thread pinning issue. But only for SSEEmitter. Still there are several synchronized block in ResponseBodyEmitter.

public synchronized void send(Object object, @Nullable MediaType mediaType) throws IOException {

public synchronized void send(Set<DataWithMediaType> items) throws IOException {

To prevent thread pinning when using virtual thread, it have to replaced with ReentrantLock.

Many of us cannot move to JDK 24 yet (which reduces synchronized pinning), so we need a framework-level mitigation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    in: webIssues in web modules (web, webmvc, webflux, websocket)status: supersededAn issue that has been superseded by another

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions