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

binance ws ping/pong protocol errors? #423

Closed
goodboy opened this issue Nov 17, 2022 · 1 comment
Closed

binance ws ping/pong protocol errors? #423

goodboy opened this issue Nov 17, 2022 · 1 comment
Labels
broker-backend `brokerd`/`datad` related backend tech bug guille broke it prolly data-layer real-time and historical data processing and storage newb friendly

Comments

@goodboy
Copy link
Contributor

goodboy commented Nov 17, 2022

Been seeing this recently while testing multichartz in #420.

No idea where it's borked but seems like binance changed something on the server end?

Attaching to pdb in crashed actor: ('brokerd.binance', 'a990ae42-605a-44da-b3e7-c978d7602e0b')

Traceback (most recent call last):
  File "/home/goodboy/repos/tractor/tractor/_runtime.py", line 196, in _invoke
    res = await coro
  File "/home/goodboy/repos/piker/piker/data/feed.py", line 246, in _setup_persistent_brokerd
    async with trio.open_nursery() as service_nursery:
  File "/home/goodboy/.virtualenvs/piker310/lib/python3.10/site-packages/trio/_core/_run.py", line 850, in __aexit__
    raise combined_error_from_nursery
  File "/home/goodboy/repos/piker/piker/brokers/binance.py", line 541, in stream_quotes
    async for typ, msg in msg_gen:
  File "/home/goodboy/repos/piker/piker/brokers/binance.py", line 323, in stream_messages
    await ws._connect()
  File "/home/goodboy/repos/piker/piker/data/_web_bs.py", line 74, in _connect
    await self._stack.aclose()
  File "/usr/lib/python3.10/contextlib.py", line 656, in aclose
    await self.__aexit__(None, None, None)
  File "/usr/lib/python3.10/contextlib.py", line 714, in __aexit__
    raise exc_details[1]
  File "/usr/lib/python3.10/contextlib.py", line 697, in __aexit__
    cb_suppress = await cb(*exc_details)
  File "/home/goodboy/.virtualenvs/piker310/lib/python3.10/site-packages/async_generator/_util.py", line 42, in __aexit__
    await self._agen.asend(None)
  File "/home/goodboy/.virtualenvs/piker310/lib/python3.10/site-packages/async_generator/_impl.py", line 366, in step
    return await ANextIter(self._it, start_fn, *args)
  File "/home/goodboy/.virtualenvs/piker310/lib/python3.10/site-packages/async_generator/_impl.py", line 202, in send
    return self._invoke(self._it.send, value)
  File "/home/goodboy/.virtualenvs/piker310/lib/python3.10/site-packages/async_generator/_impl.py", line 209, in _invoke
    result = fn(*args)
  File "/home/goodboy/.virtualenvs/piker310/lib/python3.10/site-packages/trio_websocket/_impl.py", line 105, in open_websocket
    async with trio.open_nursery() as new_nursery:
  File "/home/goodboy/.virtualenvs/piker310/lib/python3.10/site-packages/trio/_core/_run.py", line 850, in __aexit__
    raise combined_error_from_nursery
  File "/home/goodboy/.virtualenvs/piker310/lib/python3.10/site-packages/trio_websocket/_impl.py", line 1205, in _reader_task
    await handler(event)
  File "/home/goodboy/.virtualenvs/piker310/lib/python3.10/site-packages/trio_websocket/_impl.py", line 1145, in _handle_ping_event
    await self._send(event.response())
  File "/home/goodboy/.virtualenvs/piker310/lib/python3.10/site-packages/trio_websocket/_impl.py", line 1249, in _send
    data = self._wsproto.send(event)
  File "/home/goodboy/.virtualenvs/piker310/lib/python3.10/site-packages/wsproto/__init__.py", line 64, in send
    data += self.connection.send(event)
  File "/home/goodboy/.virtualenvs/piker310/lib/python3.10/site-packages/wsproto/connection.py", line 107, in send
    raise LocalProtocolError(
wsproto.utilities.LocalProtocolError: Event Pong(payload=bytearray(b'1668724541329')) cannot be sent in state ConnectionState.LOCAL_CLOSING.

Likely we just want an error handler block that triggers a reconnect for this?

@goodboy goodboy added bug guille broke it prolly data-layer real-time and historical data processing and storage newb friendly broker-backend `brokerd`/`datad` related backend tech labels Nov 17, 2022
@goodboy
Copy link
Contributor Author

goodboy commented Feb 3, 2023

Pretty sure this was solved as part of #431.

@goodboy goodboy closed this as completed Feb 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
broker-backend `brokerd`/`datad` related backend tech bug guille broke it prolly data-layer real-time and historical data processing and storage newb friendly
Projects
None yet
Development

No branches or pull requests

1 participant