Skip to content

DataBufferUtils#join could leak buffers in case of error from the source [SPR-17025] #21563

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

Closed
spring-projects-issues opened this issue Jul 9, 2018 · 3 comments
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: bug A general bug
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Jul 9, 2018

Rossen Stoyanchev opened SPR-17025 and commented

This came up from a discussion about having a client filter to enforce a limit on the content length of the response. Possibly buffering the content received before the limit and having an exception with the buffered content. DataBufferUtils#join could be very useful, if inserted after the limit enforcement.

Even beyond such a filter, the join method is used in a lot of decoders, and can leak pooled buffers in case of errors while reading. This could be considered an improvement but I've marked it as a bug only because I don't see any options to work around the issue.

This issue should also look at all the places (like codecs) where we are queuing buffer in queues and clean them accordingly in case of errors.

 

 


Affects: 5.0.7

Issue Links:

Referenced from: commits 259b2ca, a006073, 196c0ad

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Sep 5, 2018

Arjen Poutsma commented

The issue with DataBufferUtils.join is now fixed in 259b2ca, with further tests added in 196c0ad.

I've created another issue to track onDiscardQueueWithClear introduction, see #21779.

@spring-projects-issues
Copy link
Collaborator Author

Arjen Poutsma commented

Reopening for back port

@spring-projects-issues
Copy link
Collaborator Author

Arjen Poutsma commented

Backported in a006073

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants