-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Close websocket connection when pong not received #1814
Labels
Comments
it should be fixed in master |
should be fixed in 2.0.7 |
This was referenced Dec 6, 2018
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hello.
I need to disconnect inactive connections to save resources.
The ping/pong perfectly suited, I think it's fine for this.
I installed heartbeat=60 in WebSocketResponse.
But after 60 seconds the connection is not closed and instead throws an exception:
Exception in callback WebSocketResponse._pong_not_received() handle: <TimerHandle when=785637 WebSocketResponse._pong_not_received()> Traceback (most recent call last): File "/usr/local/lib/python3.6/asyncio/events.py", line 127, in _run self._callback(*self._args) File "/lib/python3.6/site-packages/aiohttp/web_ws.py", line 88, in _pong_not_received self._req.transport.close() AttributeError: 'NoneType' object has no attribute 'close'
And I also saw that autoping=True by default, and heartbeat=None through what interval in this case will ping for the connections?
Environment:
Python 3.6.1
aiohttp 2.0.6
Ubuntu 12.04
I did something wrong, or is it a bug in the code?
The text was updated successfully, but these errors were encountered: