-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Keep-alive connections prevent server from shutdown #1221
Labels
Comments
Would you create a PR? |
tahajahangir
added a commit
to tahajahangir/aiohttp
that referenced
this issue
Sep 28, 2016
asvetlov
pushed a commit
that referenced
this issue
Sep 29, 2016
Fixed by #1222 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Long story short
If a keep-alive connection be open (and this is very common) closing server with
^C
will stuck (for 60 seconds), and process will not exit until this timeout.This is important because during normal operation (simple HTTP request) browsers (at least Chrome and Firefox) is keeping connections alive for a while.
Expected behaviour
Normally, connections with no active http request should be closed immediately, and server should exit.
The open connections will stuck in: aiohttp/server.py#L232
And the whole process will stuck in: aiohttp/web.py#L287
I guess connections with
_reading_requese=False
can be closed immediately inshutdown
.Actual behaviour
Server process remains running!
Steps to reproduce
1- run a simple server:
2- Open Firefox/Chrome and visit http://127.0.0.1:8000, this will result in a 404 response
3- Close the server with
^C
, server will not exit!Your environment
aiohttp 1.0.2
Python 3.5.2
Arch Linux
The text was updated successfully, but these errors were encountered: