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

Webflux doesn't close the connection where request heads has "connection: close" [SPR-16309] #20856

Closed
spring-projects-issues opened this issue Dec 18, 2017 · 6 comments
Assignees
Labels
in: web status: invalid

Comments

@spring-projects-issues
Copy link
Collaborator

@spring-projects-issues spring-projects-issues commented Dec 18, 2017

Alex opened SPR-16309 and commented

Here's a the controller

@GetMapping("/ok")
String ok() {     
    return "ok"; 
}                 

if telneting the server and sending the followed request, the server would send the response headers but not close the connection, while in webmvc it would close.

HEAD /ok HTTP/1.0
Host: 127.0.0.1
Accept: */*
Connection: close

Affects: 5.0.2

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Dec 18, 2017

Brian Clozel commented

Hi!
Could you tell us which web server are you using? How are you running your Spring WebFlux application?

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Dec 18, 2017

Alex commented

I'm using spring-boot-starter-webflux:2.0.0.BUILD-SNAPSHOT to build my app, and there no server specified in config file nor included in build file , so i think it would be the default netty.

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Dec 18, 2017

Rossen Stoyanchev commented

We don't have control over the connection at the web framework level, so it sounds like a Reactor Netty issue. For a quick experiment, try adding "spring-boot-starter-tomcat" to see how WebFlux on Tomcat behaves. I suspect it will work as expected since it works on Spring MVC.

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Dec 18, 2017

Brian Clozel commented

Reactor Netty does not support HTTP 1.0, so this might be the underlying issue here.

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Dec 19, 2017

Alex commented

After adding "spring-boot-starter-tomcat" it works as expected. It has good behavior on handling HTTP 1.0 and the Connection header. The link quoted by Brian is very useful. It might be the Reactor Netty's issue. Thx

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Dec 19, 2017

Brian Clozel commented

I'm closing this since this is a Reactor Netty issue.
Thanks for testing Alex!

@spring-projects-issues spring-projects-issues added type: bug status: invalid in: web labels Jan 11, 2019
@spring-projects-issues spring-projects-issues removed the type: bug label Jan 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web status: invalid
Projects
None yet
Development

No branches or pull requests

2 participants