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

Fix ob_updater subscribe_ws error handling #4

Open
firepol opened this issue Jan 13, 2019 · 1 comment
Open

Fix ob_updater subscribe_ws error handling #4

firepol opened this issue Jan 13, 2019 · 1 comment
Labels
help wanted Extra attention is needed

Comments

@firepol
Copy link
Owner

firepol commented Jan 13, 2019

In ob_updater, subscribe_ws I removed these lines and added a TODO to this issue.

    error_message = type(err).__name__ + ":" + str(err)
    logging.error(f'{exchange.id}: {error_message}')
    logging.error(error_stack)

The problem is that the error is not logged. Try to run binance and cexio at the same time to get some errors.

Also, I removed these lines:

    await exchange.close()
    raise WsError(exchange.id)

This was causing binance websockets to stop. My idea was to close the channel with the problematic exchange/pair, not shut down ALL channels from one exchange.

Ideally I'd like to re-subscribe the websocket that is causing errors (or that got disconnected).

To reproduce:

settings.ini

[config]
db_url: postgres://dbusr:dbpwd@localhost:5432/cryptows
order_book_entries_limit: 1

[binance]
symbols: BTC/USDT
         EOS/USDT
         ETH/USDT

[cex]
symbols: BTC/USD
         BTC/EUR

Run:

./ob_updater.py --reset_db

Error I get:

subscribed: cex BTC/USD
subscribed: cex BTC/EUR
subscribed: binance BTC/USDT
binance, 2019-01-17 23:27:57.255584, [<FrameSummary file /home/paul/projects-python/ccxtws/ob_updater.py, line 142 in >, <FrameSummary file /home/paul/projects-python/ccxtws/ob_updater.py, line 68 in main>, <FrameSummary file /usr/lib/python3.6/asyncio/base_events.py, line 427 in run_forever>, <FrameSummary file /usr/lib/python3.6/asyncio/base_events.py, line 1440 in _run_once>, <FrameSummary file /usr/lib/python3.6/asyncio/events.py, line 145 in _run>, <FrameSummary file /home/paul/projects-python/ccxtws/ob_updater.py, line 88 in websocket_error>]
subscribed: binance EOS/USDT
subscribed: binance ETH/USDT

@lfern
Copy link

lfern commented Jan 25, 2019

Sorry @firepol I don't have a cex account to test, I have reported to cex support, but still doesn't work ( I don't receive any confirmation email from CEX). It's weird that you get this issue only in combination with cex. Maybe something wrong in cex implementaion, I couldn't check it out recently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants