Skip to content

Reduce synchronization in ResponseBodyEmitter #34767

Open
@rstoyanchev

Description

@rstoyanchev

ResponseBodyEmitter relies on synchronization to protect against concurrent use of the response, and also for the caching of early messages (e.g. before the emitter is returned from the controller method) to be properly detected from another thread that sends after initialization.

After #32340, protection against concurrent use of the response is built deeper at the level of StandardServletAsyncWebRequest, so we can revisit ResponseBodyEmitter and leave only synchronization that is actually necessary.

See also #34762 (comment) for related efforts in 6.2.x to optimize performance.

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

Issue actions