Skip to content

Bug after connection loss on macos in ws.send() #43

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

Closed
oliver-zehentleitner opened this issue Feb 25, 2020 · 0 comments
Closed

Bug after connection loss on macos in ws.send() #43

oliver-zehentleitner opened this issue Feb 25, 2020 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@oliver-zehentleitner
Copy link
Member

Exception in thread Thread-512:
Traceback (most recent call last):
File
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/threading.py",
line 917, in _bootstrap_inner
self.run()
File
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/threading.py",
line 865, in run
self._target(*self._args, **self._kwargs)
File
"/Users/oliver/pycharmlocal/unicorn-binance-websocket-api/unicorn_binance_websocket_api/unicorn_binance_websocket_api_manager.py",
line 252, in _create_stream_thread
loop.run_until_complete(binance_websocket_api_socket.start_socket())
File
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/base_events.py",
line 584, in run_until_complete
return future.result()
File
"/Users/oliver/pycharmlocal/unicorn-binance-websocket-api/unicorn_binance_websocket_api/unicorn_binance_websocket_api_socket.py",
line 55, in start_socket
self.channels, self.markets) as websocket:
File
"/Users/oliver/pycharmlocal/unicorn-binance-websocket-api/unicorn_binance_websocket_api/unicorn_binance_websocket_api_connection.py",
line 106, in aenter
await self.send(json.dumps(payload, ensure_ascii=False))
File
"/Users/oliver/pycharmlocal/unicorn-binance-websocket-api/unicorn_binance_websocket_api/unicorn_binance_websocket_api_connection.py",
line 253, in send
await
self.handler_binance_websocket_api_manager.websocket_list[self.stream_id].send(data)
File
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/websockets/protocol.py",
line 467, in send
yield from self.write_frame(True, OP_TEXT, data.encode('utf-8'))
File
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/websockets/protocol.py",
line 913, in write_frame
yield from self.writer.drain()
File
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/streams.py",
line 339, in drain
raise exc
File
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/websockets/protocol.py",
line 674, in transfer_data
message = yield from self.read_message()
File
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/websockets/protocol.py",
line 742, in read_message
frame = yield from self.read_data_frame(max_size=self.max_size)
File
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/websockets/protocol.py",
line 815, in read_data_frame
frame = yield from self.read_frame(max_size)
File
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/websockets/protocol.py",
line 884, in read_frame
extensions=self.extensions,
File
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/websockets/framing.py",
line 99, in read
data = yield from reader(2)
File
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/streams.py",
line 679, in readexactly
await self._wait_for_data('readexactly')
File
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/streams.py",
line 473, in _wait_for_data
await self._waiter
File
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/sslproto.py",
line 664, in _process_write_backlog
data, offset = self._write_backlog[0]
IndexError: deque index out of range

Exception in thread Thread-517:
Traceback (most recent call last):
File
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/threading.py",
line 917, in _bootstrap_inner
self.run()
File
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/threading.py",
line 865, in run
self._target(*self._args, **self._kwargs)
File
"/Users/oliver/pycharmlocal/unicorn-binance-websocket-api/unicorn_binance_websocket_api/unicorn_binance_websocket_api_manager.py",
line 252, in _create_stream_thread
loop.run_until_complete(binance_websocket_api_socket.start_socket())
File
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/base_events.py",
line 584, in run_until_complete
return future.result()
File
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/websockets/protocol.py",
line 674, in transfer_data
message = yield from self.read_message()
File
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/websockets/protocol.py",
line 742, in read_message
frame = yield from self.read_data_frame(max_size=self.max_size)
File
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/websockets/protocol.py",
line 815, in read_data_frame
frame = yield from self.read_frame(max_size)
File
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/websockets/protocol.py",
line 884, in read_frame
extensions=self.extensions,
File
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/websockets/framing.py",
line 99, in read
data = yield from reader(2)
File
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/streams.py",
line 679, in readexactly
await self._wait_for_data('readexactly')
File
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/streams.py",
line 473, in _wait_for_data
await self._waiter
File
"/Users/oliver/pycharmlocal/unicorn-binance-websocket-api/unicorn_binance_websocket_api/unicorn_binance_websocket_api_socket.py",
line 55, in start_socket
self.channels, self.markets) as websocket:
File
"/Users/oliver/pycharmlocal/unicorn-binance-websocket-api/unicorn_binance_websocket_api/unicorn_binance_websocket_api_connection.py",
line 106, in aenter
await self.send(json.dumps(payload, ensure_ascii=False))
File
"/Users/oliver/pycharmlocal/unicorn-binance-websocket-api/unicorn_binance_websocket_api/unicorn_binance_websocket_api_connection.py",
line 253, in send
await
self.handler_binance_websocket_api_manager.websocket_list[self.stream_id].send(data)
File
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/websockets/protocol.py",
line 467, in send
yield from self.write_frame(True, OP_TEXT, data.encode('utf-8'))
File
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/websockets/protocol.py",
line 913, in write_frame
yield from self.writer.drain()
File
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/streams.py",
line 339, in drain
raise exc
File
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/sslproto.py",
line 689, in _process_write_backlog
del self._write_backlog[0]
IndexError: deque index out of range

Exception in thread Thread-521:
Traceback (most recent call last):
File
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/threading.py",
line 917, in _bootstrap_inner
self.run()
File
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/threading.py",
line 865, in run
self._target(*self._args, **self._kwargs)
File
"/Users/oliver/pycharmlocal/unicorn-binance-websocket-api/unicorn_binance_websocket_api/unicorn_binance_websocket_api_manager.py",
line 252, in _create_stream_thread
loop.run_until_complete(binance_websocket_api_socket.start_socket())
File
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/base_events.py",
line 584, in run_until_complete
return future.result()
File
"/Users/oliver/pycharmlocal/unicorn-binance-websocket-api/unicorn_binance_websocket_api/unicorn_binance_websocket_api_socket.py",
line 55, in start_socket
self.channels, self.markets) as websocket:
File
"/Users/oliver/pycharmlocal/unicorn-binance-websocket-api/unicorn_binance_websocket_api/unicorn_binance_websocket_api_connection.py",
line 106, in aenter
await self.send(json.dumps(payload, ensure_ascii=False))
File
"/Users/oliver/pycharmlocal/unicorn-binance-websocket-api/unicorn_binance_websocket_api/unicorn_binance_websocket_api_connection.py",
line 253, in send
await
self.handler_binance_websocket_api_manager.websocket_list[self.stream_id].send(data)
File
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/websockets/protocol.py",
line 467, in send
yield from self.write_frame(True, OP_TEXT, data.encode('utf-8'))
File
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/websockets/protocol.py",
line 913, in write_frame
yield from self.writer.drain()
File
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/streams.py",
line 339, in drain
raise exc
File
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/websockets/protocol.py",
line 674, in transfer_data
message = yield from self.read_message()
File
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/websockets/protocol.py",
line 742, in read_message
frame = yield from self.read_data_frame(max_size=self.max_size)
File
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/websockets/protocol.py",
line 815, in read_data_frame
frame = yield from self.read_frame(max_size)
File
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/websockets/protocol.py",
line 884, in read_frame
extensions=self.extensions,
File
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/websockets/framing.py",
line 99, in read
data = yield from reader(2)
File
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/streams.py",
line 679, in readexactly
await self._wait_for_data('readexactly')
File
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/streams.py",
line 473, in _wait_for_data
await self._waiter
File
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/sslproto.py",
line 664, in _process_write_backlog
data, offset = self._write_backlog[0]
IndexError: deque index out of range

Exception in thread Thread-523:
Traceback (most recent call last):
File
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/threading.py",
line 917, in _bootstrap_inner
self.run()
File
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/threading.py",
line 865, in run
self._target(*self._args, **self._kwargs)
File
"/Users/oliver/pycharmlocal/unicorn-binance-websocket-api/unicorn_binance_websocket_api/unicorn_binance_websocket_api_manager.py",
line 252, in _create_stream_thread
loop.run_until_complete(binance_websocket_api_socket.start_socket())
File
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/base_events.py",
line 584, in run_until_complete
return future.result()
File
"/Users/oliver/pycharmlocal/unicorn-binance-websocket-api/unicorn_binance_websocket_api/unicorn_binance_websocket_api_socket.py",
line 55, in start_socket
self.channels, self.markets) as websocket:
File
"/Users/oliver/pycharmlocal/unicorn-binance-websocket-api/unicorn_binance_websocket_api/unicorn_binance_websocket_api_connection.py",
line 106, in aenter
await self.send(json.dumps(payload, ensure_ascii=False))
File
"/Users/oliver/pycharmlocal/unicorn-binance-websocket-api/unicorn_binance_websocket_api/unicorn_binance_websocket_api_connection.py",
line 253, in send
await
self.handler_binance_websocket_api_manager.websocket_list[self.stream_id].send(data)
File
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/websockets/protocol.py",
line 467, in send
yield from self.write_frame(True, OP_TEXT, data.encode('utf-8'))
File
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/websockets/protocol.py",
line 913, in write_frame
yield from self.writer.drain()
File
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/streams.py",
line 339, in drain
raise exc
File
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/websockets/protocol.py",
line 674, in transfer_data
message = yield from self.read_message()
File
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/websockets/protocol.py",
line 742, in read_message
frame = yield from self.read_data_frame(max_size=self.max_size)
File
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/websockets/protocol.py",
line 815, in read_data_frame
frame = yield from self.read_frame(max_size)
File
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/websockets/protocol.py",
line 884, in read_frame
extensions=self.extensions,
File
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/websockets/framing.py",
line 99, in read
data = yield from reader(2)
File
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/streams.py",
line 679, in readexactly
await self._wait_for_data('readexactly')
File
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/streams.py",
line 473, in _wait_for_data
await self._waiter
File
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/sslproto.py",
line 664, in _process_write_backlog
data, offset = self._write_backlog[0]
IndexError: deque index out of range

@oliver-zehentleitner oliver-zehentleitner added the bug Something isn't working label Feb 25, 2020
@oliver-zehentleitner oliver-zehentleitner self-assigned this Feb 25, 2020
oliver-zehentleitner added a commit that referenced this issue Feb 25, 2020
- thread lock for `frequent_checks_list` ([comment #590914274](#11 (comment)))
Seven-112 pushed a commit to Seven-112/unicorn-binance-websocket-api that referenced this issue May 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant