Skip to content

HTTP GET from Chrome with WebFlux Rest Controller never completes [SPR-17506] #22038

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 Nov 16, 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 Nov 16, 2018

Robbert van Waveren opened SPR-17506 and commented

Expected behavior:
Every request is handled the same way.

Observed behavior:

When returning Mono.empty() from an @RestController the following occurs:

When Chrome is used to make the GET requests the first request is handled on reactor-http-nio-2 thread and seems to be handled correct.
When making a second request (using F5) after that (using keep-alive) the request is handled on the same reactor-http-nio-2 thread, however this request never completes according to chrome and keeps in the "pending" state forever.
When making another request (using F5) after that, the request is handled by reactor-http-nio-1 thread and seems to be handled correct.
When making another request (using F5) after that, the request is handled by the same reactor-http-nio-1 thread and again never completes.

The behavior is repeatable, failing exactly 50% of requests (the second request on the same reactor thread).

tested using Windows 10 / Chrome 70.0.3538.102

Note that the TRACE logging actually shows the same logging for both the properly handled and the failing requests as if completed succesfully.

Furthermore all requests that seem to be handled by the same tcp/ip connection and reactor-thread also use the same log prefix for which I'll make a separate ticket.


Affects: 5.1.2

Attachments:

Issue Links:

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Nov 19, 2018

Rossen Stoyanchev commented

#21753 addressed a similar issue but for a client-side POST with an empty body. At the same time that solution does not work for the case here. For some reason, on an HTTP GET, writing byte[0] to the Reactor Netty server response with "content-length" set to 0, never emits a completion signal. There may be a Reactor Netty issue. Violeta Georgieva, smaldini, let me know if you think that deserves a Reactor Netty issue to be opened?

That said, using response.setComplete() in case of empty content is cleaner than writing byte[0], so I'll switch to that.

@spring-projects-issues
Copy link
Collaborator Author

Violeta Georgieva commented

Most probably it is this issue reactor/reactor-netty#518

@spring-projects-issues
Copy link
Collaborator Author

Rossen Stoyanchev commented

Yes a duplicate I believe.

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