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

_pong_response_cb does not close websocket #4755

Open
louisabraham opened this issue May 19, 2020 · 0 comments
Open

_pong_response_cb does not close websocket #4755

louisabraham opened this issue May 19, 2020 · 0 comments
Labels

Comments

@louisabraham
Copy link

louisabraham commented May 19, 2020

I'm running a web app and have the infamous socket.send() raised exception. bug.

I cannot give any reproducible example but I ran the loop in a thread, thus giving me access to the REPL.

I created my WebSocket with web.WebSocketResponse(heartbeat=5).

The problem seems to be that _pong_not_received was called but did not close the websocket. The REPL indicates that ws._req.transport is None, which is the reason why it does not do anything.

aiohttp/aiohttp/web_ws.py

Lines 113 to 118 in 48bf8c3

def _pong_not_received(self) -> None:
if self._req is not None and self._req.transport is not None:
self._closed = True
self._close_code = 1006
self._exception = asyncio.TimeoutError()
self._req.transport.close()

Why is the condition checked? I think the assumptions are too strong and the check should only be made before calling self._req.transport.close().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant