Open
Description
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.