-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
ERROR: CANCEL read_loop, websocket updates loss #1465
Comments
I just wrote my simple multiplex socket using pure websockets version 13.1. It works just great, no errors, no data loss. |
@Ramesses3, can you assemble a simple script that uses your implementation and python-binance simultaneously, compares the output, and throws an error when one starts to lag behind? |
Hi @Ramesses3 , I was able to reproduce the error. The issue is that the while loop needs to be inside the stream context: async with ms as stream:
while true: If not the stream will continuously connect and reconnect after each message, and this is whats causing the Cancel read loop log and the probable loss of data I will adjust the logs and docs so this is easier to find the in the future. I also struggled a while from the docs, as it is showing up as an error when it shouldn't. |
Hi @pcriadoperez , |
@pcriadoperez thank you one more time. Now it works fine! |
Bug description
I'm trying to get kline data via a web socket. Interested in closing candles. I noticed that some of the data is lost, although if you check in parallel through postman, then all updates come there.
Also, my python script periodically throws a CANCEL read_loop error. I think the data loss is related to it.
To Reproduce
Run my simple code:
Expected behavior
Continuous acquisition of all data from the stream(s) without loss.
Environment:
The text was updated successfully, but these errors were encountered: