foxglove / ws-protocol

Foxglove Studio WebSocket protocol specification and libraries

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Server does not correctly handle send on closing websocket connection

KerstinKeller opened this issue · comments

When sending data while a websocket connection is being closed / refreshed on studio side, the server side might get the following error:

 future: <Task finished name='Task-1636' coro=<FoxgloveServer.handle_message() done, defined at foxglove_websocket\server.py:182> exception=InvalidState('Cannot write to a WebSocket in the CLOSING state')>
 Traceback (most recent call last):
   File "foxglove_websocket\server.py", line 186, in handle_message
   File "foxglove_websocket\server.py", line 207, in _send_message_data
   File "websockets\legacy\protocol.py", line 655, in send
   File "websockets\legacy\protocol.py", line 1184, in write_frame
 websockets.exceptions.InvalidState: Cannot write to a WebSocket in the CLOSING state
 Task exception was never retrieved

Expected Behavior
No data is sent, but no crashing

Actual Behavior
Exception printed