-
Notifications
You must be signed in to change notification settings - Fork 312
Description
Depending on the moment, regularly webstreams disconnect. It usually stays active for 2-3 hours and sometimes disconnects then with this error:
Task exception was never retrieved
future: <Task finished name='Task-8' coro=<WsPublicAsync.consume() done, defined at /home/blabla/.local/lib/python3.11/site-packages/okx/websocket/WsPublicAsync.py:21> exception=ConnectionClosedError(None, None, None)>
Traceback (most recent call last):
File "/home/blabla/.local/lib/python3.11/site-packages/websockets/legacy/protocol.py", line 963, in transfer_data
message = await self.read_message()
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/blabla/.local/lib/python3.11/site-packages/websockets/legacy/protocol.py", line 1033, in read_message
frame = await self.read_data_frame(max_size=self.max_size)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/blabla/.local/lib/python3.11/site-packages/websockets/legacy/protocol.py", line 1108, in read_data_frame
frame = await self.read_frame(max_size)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/blabla/.local/lib/python3.11/site-packages/websockets/legacy/protocol.py", line 1165, in read_frame
frame = await Frame.read(
^^^^^^^^^^^^^^^^^
File "/home/blabla/.local/lib/python3.11/site-packages/websockets/legacy/framing.py", line 68, in read
data = await reader(2)
^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/asyncio/streams.py", line 726, in readexactly
raise exceptions.IncompleteReadError(incomplete, n)
asyncio.exceptions.IncompleteReadError: 0 bytes read on a total of 2 expected bytes
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/blabla/.local/lib/python3.11/site-packages/okx/websocket/WsPublicAsync.py", line 22, in consume
async for message in self.websocket:
File "/home/blabla/.local/lib/python3.11/site-packages/websockets/legacy/protocol.py", line 498, in aiter
yield await self.recv()
^^^^^^^^^^^^^^^^^
File "/home/blabla/.local/lib/python3.11/site-packages/websockets/legacy/protocol.py", line 568, in recv
await self.ensure_open()
File "/home/blabla/.local/lib/python3.11/site-packages/websockets/legacy/protocol.py", line 934, in ensure_open
raise self.connection_closed_exc()
websockets.exceptions.ConnectionClosedError: no close frame received or sent