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

Keep-alive connections prevent server from shutdown #1221

Closed
tahajahangir opened this issue Sep 28, 2016 · 3 comments
Closed

Keep-alive connections prevent server from shutdown #1221

tahajahangir opened this issue Sep 28, 2016 · 3 comments
Labels

Comments

@tahajahangir
Copy link
Contributor

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 in shutdown.

Actual behaviour

Server process remains running!

Steps to reproduce

1- run a simple server:

import aiohttp.web
app = aiohttp.web.Application(debug=True)
aiohttp.web.run_app(app, host='127.0.0.1', port=8000)

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

@asvetlov
Copy link
Member

Would you create a PR?
I think subscribing on SIGINT may be used.

@asvetlov
Copy link
Member

Fixed by #1222

@lock
Copy link

lock bot commented Oct 29, 2019

This thread has been automatically locked since there has not been
any recent activity after it was closed. Please open a new issue for
related bugs.

If you feel like there's important points made in this discussion,
please include those exceprts into that new issue.

@lock lock bot added the outdated label Oct 29, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants