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

InvalidStateError #110

Closed
oliver-zehentleitner opened this issue Sep 21, 2020 · 2 comments
Closed

InvalidStateError #110

oliver-zehentleitner opened this issue Sep 21, 2020 · 2 comments
Assignees
Labels
bug Something isn't working
Projects

Comments

@oliver-zehentleitner
Copy link
Member

oliver-zehentleitner commented Sep 21, 2020

Related to issue #18, #105, #83

The first issue #18 was created in Jun 2019 by @DaWe35 who reported this error:

Exception in thread Thread-3:
Traceback (most recent call last):
  File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.6/threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "/home/user/.local/lib/python3.6/site-packages/unicorn_binance_websocket_api/unicorn_binance_websocket_api_manager.py", line 142, in _create_stream_thread
    loop.run_until_complete(binance_websocket_api_socket.start_socket())
  File "/usr/lib/python3.6/asyncio/base_events.py", line 484, in run_until_complete
    return future.result()
  File "/home/user/.local/lib/python3.6/site-packages/unicorn_binance_websocket_api/unicorn_binance_websocket_api_socket.py", line 62, in start_socket
    received_stream_data_json = await websocket.receive()
  File "/home/user/.local/lib/python3.6/site-packages/unicorn_binance_websocket_api/unicorn_binance_websocket_api_connection.py", line 183, in receive
    received_data = await self.handler_binance_websocket_api_manager.websocket_list[self.stream_id].recv()
  File "/home/user/.local/lib/python3.6/site-packages/websockets/protocol.py", line 441, in recv
    self._put_message_waiter.set_result(None)
asyncio.base_futures.InvalidStateError: invalid state

We added an error handling for asyncio.base_futures.InvalidStateError: invalid state and a restart process for the stream and it worked well for a while.

In Nov 2019 the websockets 8.1 was released and we switched over to it as a requirement, we are using newer python versions and it looks like, that something important has changed.

So I think its the best to remove that code part and lets see whats happens then..

If someone is receiving a new InvalidStateError please post

  1. websockets version
  2. python version
  3. OS
  4. stream_buffer or process_stream_data

in this issue below!

@oliver-zehentleitner
Copy link
Member Author

oliver-zehentleitner commented Sep 21, 2020

Please update to 1.17.4 and start testing!

@oliver-zehentleitner oliver-zehentleitner added this to Suspended in Todo Sep 23, 2020
@oliver-zehentleitner
Copy link
Member Author

Looks good till now :)

We can reopen if needed!

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
Todo
  
Done
Development

No branches or pull requests

1 participant