ccxt: kucoin watch_order_book initial snapshot error
- OS: ubuntu 16.04
- Programming Language version: python 3.6.5
- CCXT version: 0.1.67
Happens intermittently when trying to subscribe to many pairs. Once it happens the stream never recovers. Would be great if there was a way to detect stale streams and automatically restart
Having trouble reproducing locally, I think it’s related to rate limiting where kucoin will return a blank response or something. Is it possible to add a retry on the initial book snapshot?
enableRateLimiting is set to True here
File "/python3.6/site-packages/ccxtpro/kucoin.py", line 227, in watch_order_book
return await self.after(future, self.limit_order_book, symbol, limit, params)
File "/python3.6/site-packages/ccxtpro/base/exchange.py", line 77, in after
return method(await future, *args)
File "/python3.6/site-packages/ccxtpro/base/exchange.py", line 80, in after_async
return await method(await future, *args)
File "/python3.6/site-packages/ccxtpro/kucoin.py", line 111, in subscribe
return await self.watch(url, messageHash, request, messageHash, subscription)
File "/python3.6/site-packages/ccxtpro/kucoin.py", line 243, in fetch_order_book_snapshot
previousSequence = sequenceStart - 1
TypeError: unsupported operand type(s) for -: 'NoneType' and 'int'
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 23 (23 by maintainers)
Commits related to this issue
- exchange.py throttle rate limiter edits #6820 — committed to ccxt/ccxt by kroitor 4 years ago
- exchange.py throttle rate limiter edits #6820 — committed to bitpanda-labs/ccxt by kroitor 4 years ago
Yep, basically, you can play with those settings to adjust for the networking environment. Let me know if you experience any further difficulties with it. In the meantime we will try to address that in a more robust way. Thx for your involvement, appreciate it!
Looks like this works, awesome thanks!
None
Great, thank you!
@kroitor -
Pretty much all of them, here’s some that I’ve seen failed:
I was thinking maybe it’s just limited to low volume pairs, but some of these pairs definitely have activity