-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
HTTPServer pass no_keep_alive option to conn params #1963
Conversation
As further clarification, the request handler should still add the |
Side question: would it make sense to remove the |
Thanks for the fix for this (untested) feature; looks like it's been broken since the http1connection refactoring. Since it's there we might as well fix it, although it's been broken so long there's little evidence that anyone actually cares (so maybe we should just drop it in a future release). The http1connection refactoring also means that we're able to inject the
That's deliberate. In TCP-based protocols it is encouraged to initiate the close on the client side because the side that initiates the close will have a Removing the |
@bdarnell following on from this:
and this from https://tools.ietf.org/html/rfc2616#section-8.1.2
shouldn't Tornado include |
The default behavior for tornado HTTPServer is to not close the connections. Does your tornado-using application specify |
The tornado application is the Jupyter Kernel Gateway (https://github.com/jupyter/kernel_gateway). It does not set So when, the client makes a request with |
I see - yes, tornado does close the connection when it receives the "Connection: close" header. But it seems like the proxy should realize it sent the request with that header, and you could configure it to not send that header. Quoting from https://tools.ietf.org/html/rfc2616#section-14.10
...
That said, I can see why there might possibly be some value in a tornado HTTPServer option to always wait for the other side to close first. |
RFC 2616 has been replaced by RFC 7230, which gives more clarity around the
So the kernel gateway is responsible for remembering that it has sent
|
regarding: #641
Currently passing
no_keep_alive=True
to HTTPServer.init while also including "Connection: Close" header in responses does not terminate connections server-side. It seems for the intended behavior to work,no_keep_alive
options needs to be passed through to the server's HTTP1ConnectionParameters.