Closed
Description
Rossen Stoyanchev opened SPR-17408 and commented
Recent, related efforts on this topic include #21563, #21779, and #21322, but those changes needs some refinement plus a comprehensive review of all DataBuffer
handling code with an eye towards error and cancellation signal cases.
This is an umbrella ticket with sub-tasks:
- Review DataBufferUtils [SPR-17411] #21944
DataBufferUtils
. - Review DataBuffer handling in Servlet and Undertow server adapters [SPR-17410] #21943
ReactorServerHttpRequest
to drop the onDiscard hook. - Review DataBuffer handling in Servlet and Undertow server adapters [SPR-17410] #21943 Reactive Streams bridge in spring-web (Servlet, Undertow, HTTP and WebSocket).
- Review decoders and message readers [SPR-17418] #21951 Decoders and message readers.
- Review encoders and message writers [SPR-17419] #21952 Encoders and message writers.
- Review Jetty ClientHttpConnector code for buffer handling on error/cancellation [SPR-17424] #21957 Jetty
ClientHttpConnector
. - Improve guidance on working with and releasing DataBuffer's [SPR-17409] #21942 Update docs for releasing data buffers on error/cancellation.
For 4) and 5) above, perhaps we should consider inserting a common onDiscard at the point of using codecs to ensure consistent behavior? Of course individual codecs still need to be able to do the right thing on their own, but perhaps a hint could be passed in to indicate when onDiscard is handled externally..
Affects: 5.0.10, 5.1.1
Sub-tasks:
- Improve guidance on working with and releasing DataBuffer's [SPR-17409] #21942 Improve guidance on working with and releasing DataBuffer's
- Review DataBuffer handling in Servlet and Undertow server adapters [SPR-17410] #21943 Review DataBuffer handling in Servlet and Undertow server adapters
- Review DataBufferUtils [SPR-17411] #21944 Review DataBufferUtils
- Review decoders and message readers [SPR-17418] #21951 Review decoders and message readers
- Review encoders and message writers [SPR-17419] #21952 Review encoders and message writers
- Review Jetty ClientHttpConnector code for buffer handling on error/cancellation [SPR-17424] #21957 Review Jetty ClientHttpConnector code for buffer handling on error/cancellation
Issue Links:
- DataBufferUtils#join could leak buffers in case of error from the source [SPR-17025] #21563 DataBufferUtils#join could leak buffers in case of error from the source
- DataBufferUtils does not release DataBuffer on error cases [SPR-16782] #21322 DataBufferUtils does not release DataBuffer on error cases
- Use doOnDiscard to free internally queued data buffers [SPR-17246] #21779 Use doOnDiscard to free internally queued data buffers