Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Review DataBuffer handling code for proper release in case of error or cancellation [SPR-17408] #21941

spring-issuemaster opened this issue Oct 18, 2018 · 1 comment


Copy link

@spring-issuemaster spring-issuemaster commented Oct 18, 2018

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:

  1. #21944 DataBufferUtils.
  2. #21943 ReactorServerHttpRequest to drop the onDiscard hook.
  3. #21943 Reactive Streams bridge in spring-web (Servlet, Undertow, HTTP and WebSocket).
  4. #21951 Decoders and message readers.
  5. #21952 Encoders and message writers.
  6. #21957 Jetty ClientHttpConnector.
  7. #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


  • #21942 Improve guidance on working with and releasing DataBuffer's
  • #21943 Review DataBuffer handling in Servlet and Undertow server adapters
  • #21944 Review DataBufferUtils
  • #21951 Review decoders and message readers
  • #21952 Review encoders and message writers
  • #21957 Review Jetty ClientHttpConnector code for buffer handling on error/cancellation

Issue Links:

  • #21563 DataBufferUtils#join could leak buffers in case of error from the source
  • #21322 DataBufferUtils does not release DataBuffer on error cases
  • #21779 Use doOnDiscard to free internally queued data buffers

Referenced from: commits 149d416, 488a1d4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.