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

Not all connections are closed (pending: 0) #523

Closed
ikhlestov opened this issue Sep 23, 2015 · 4 comments
Closed

Not all connections are closed (pending: 0) #523

ikhlestov opened this issue Sep 23, 2015 · 4 comments
Labels

Comments

@ikhlestov
Copy link

I've receive very strange error message during usual closing connection:
loop.run_until_complete(handler.finish_connections(1.0))
like:

WARNING:aiohttp.web:Not all connections are closed (pending: 0)

Can you advise how is this possible?
I've checked RequestHandlerFactory.finish_connections method and found that inside cleanup() coroutine method self._connections still exists:

Connections in cleanup method: {<RequestHandler GET:/signal_socket connected>: <_SelectorSocketTransport fd=8 read=polling write=<idle, bufsize=0>>}
Sleep: 0.05
Connections in cleanup method: {<RequestHandler GET:/signal_socket connected>: <_SelectorSocketTransport fd=8 read=polling write=<idle, bufsize=0>>}
Sleep: 0.1
Connections in cleanup method: {<RequestHandler GET:/signal_socket connected>: <_SelectorSocketTransport fd=8 read=polling write=<idle, bufsize=0>>}
Sleep: 0.2
Connections in cleanup method: {<RequestHandler GET:/signal_socket connected>: <_SelectorSocketTransport fd=8 read=polling write=<idle, bufsize=0>>}
Sleep: 0.4

But at except statement - not:

Connections at except asyncio.TimeoutError statement: {}

I cannot say more because I not very familiar with asyncio at this moment. But I hope this will help you someway.
I use Python 3.5.0 and pyenv. And default WebSocketResponse the same as from tutorial.
If this bug is unreasonable please sorry but I don't know another place to report it and it my first bug report.
UPD: It seems if change timeout90 = timeout / 100 * 90 to lower one, for example timeout90 = timeout / 100 * 70 all works fine.

@asvetlov
Copy link
Member

Maybe because your web handlers are not finished in 1 second?
For websocket you should close connection manually, finish_connections() doesn't breaks active web-handlers but closes keep-alive connections only.

@ikhlestov
Copy link
Author

Thank you for your explanation - now I see that it just right way to close websockets prior to server manually.

@asvetlov
Copy link
Member

Let's close the issue than

@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