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

ResponseBodyEmitter doesn't get headers written immediately [SPR-13341] #17925

Closed
spring-projects-issues opened this issue Aug 11, 2015 · 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

Kenzie Togami opened SPR-13341 and commented

When returning a ReponseBodyEmitter from a controller method, the headers for the connection are not written to the stream until something is emitted. If nothing is emitted, clients timeout and think the server is unavalible.


Affects: 4.2 GA

Referenced from: commits f5210ce

@spring-projects-issues
Copy link
Collaborator Author

Rossen Stoyanchev commented

Odd, it's not what I would expect. The ResponseBodyEmitterReturnValueHandler is invoked immediately after the controller method returns and calls getBody on ServerHttpResponse in order to commit the response. Could you provide some more details on how to reproduce the behavior you're seeing?

@spring-projects-issues
Copy link
Collaborator Author

Kenzie Togami commented

Run the code in this repo with ./;gradlew jettyEclipseRun and use curl to test http://localhost:4000/sse and http://localhost:4000/sse-send. You should be able to see the bug happening.

@spring-projects-issues
Copy link
Collaborator Author

Rossen Stoyanchev commented

Okay it appears that accessing the response OutputStream is insufficient to commit the response.

@spring-projects-issues spring-projects-issues added type: bug A general bug in: web Issues in web modules (web, webmvc, webflux, websocket) labels Jan 11, 2019
@spring-projects-issues spring-projects-issues added this to the 4.2.1 milestone Jan 11, 2019
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