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

ServerSentEventHttpMessageReader does not respect maxInMemorySize and is always limited to 256k messages #24312

Closed
jacqueslemire opened this issue Jan 7, 2020 · 1 comment
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: regression A bug that is also a regression
Milestone

Comments

@jacqueslemire
Copy link

Affects: 5.2.2, 5.2.1


To reproduce:

  • Create a ServerSentEventHttpMessageReader with a decoder that has maxInMemorySize > 256k.
  • Call either read or readMono with 256k < len(message body) <= maxInMemorySize
  • DataBufferLimitException is thrown

Expected:

  • The configured buffer limit is applied and not error is thrown

The problem is that while the data decoder passed to ServerSentEventHttpMessageReader is properly configured to support a larger maxInMemorySize, that decoder is only used to decode the data part of the message. Prior to that, the SSE's body is decoded through a different decoder (private static final StringDecoder stringDecoder = StringDecoder.textPlainOnly()) which is not properly configured - nore is it accessible in any way - with the new limit.

Note that to my understanding, prior to 5.2.0 there was no limit at all imposed to the body. Now there is one (see 89d053d by @rstoyanchev) , but we have no way to adjust it.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Jan 7, 2020
@OLPMO
Copy link
Contributor

OLPMO commented Jan 9, 2020

Could you provide a minimal demo that can reproduce the problem? @jacqueslemire

@rstoyanchev rstoyanchev self-assigned this Jan 9, 2020
@rstoyanchev rstoyanchev added in: web Issues in web modules (web, webmvc, webflux, websocket) type: regression A bug that is also a regression and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Jan 9, 2020
@rstoyanchev rstoyanchev added this to the 5.2.3 milestone Jan 9, 2020
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: regression A bug that is also a regression
Projects
None yet
Development

No branches or pull requests

4 participants