-
-
Notifications
You must be signed in to change notification settings - Fork 18
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
ISymbolOrderBook Stops Receiving Updates After Random Intervals #47
Comments
Hi, does this happen for both Bybit and OKX? Or just OKX? |
For both, and for mexc. I tried them all, and its weird. |
I'll investigate. Any information that might help to reproduce? How many books are you subscribing, do you have other subscriptions running, after which time does it most often stop updating? etc |
I attempted to listen to the Solana/USDT trading pairs on OKX and Bybit, using various depth settings (5, 50, and the default). While the updates initially streamed correctly, they eventually stopped printing, and the updates handler ceased firing. Additionally, there were no logs or exceptions indicating an issue; it simply halted. |
Another issue
Bybit: Warning: [Sckt 3] error: Websocket error code ConnectionClosedPrematurely, details: The remote party closed the WebSocket connection without completing the close handshake. System.Net.WebSockets.WebSocketException (2): The remote party closed the WebSocket connection without completing the close handshake. ---> System.IO.IOException: Unable to read data from the transport connection: Connection reset by peer. --- End of inner exception stack trace ---
Bybit: Warning: [Sckt 4] error: Websocket error code ConnectionClosedPrematurely, details: The remote party closed the WebSocket connection without completing the close handshake. System.Net.WebSockets.WebSocketException (0x80004005): The remote party closed the WebSocket connection without completing the close handshake. --- End of inner exception stack trace ---
Bybit: Warning: [Sckt 1] error: Websocket error code ConnectionClosedPrematurely, details: The remote party closed the WebSocket connection without completing the close handshake. System.Net.WebSockets.WebSocketException (0x80004005): The remote party closed the WebSocket connection without completing the close handshake. --- End of inner exception stack trace --- It happened after 16 mins. |
These warnings are not directly an issue. There might be an interruption in the internet connection, or the server might disconnect. That is to be expected. The library should automatically reconnect and the book should be resynced after. |
Sure, but it didn't, it stopped working. There is no internet interruption. I tried to run it in wsl and windows as well. Same behavior. |
I haven't been able to reproduce this. Is it possible to run with a more verbose log level? Seems only warnings are logged. Or alternatively, could you create a minimal reproduction project? |
Sure, I will share a sample project with your gh |
@JKorf DemoProject shared with you, many thanks. |
Hi, I checked out your repo. The initial problem I'm having is that the console logging can't keep up with the data. So it just seems to hang somewhere at some point. |
@JKorf can you share a link? I'm not finding it |
@JKorf I'm not sure it going to work. Try to place a BP inside the callback, and you'll see it's not triggered when the prints stops. |
The version in my branch has been running for 3 hours now. It's continuously printed the top 5 levels of the order book, and a breakpoint in the best offer change callback still triggers. Have you run the version in my branch? |
@JKorf When it stops printing, if you place a BP in line 43, it will not be triggered again. it is not related to the prints. maybe I miss something. I don't want to print the order books every second, I want to print them only when an update is received. |
@JKorf Moreover, if you print the LastUpdate field (without the callback) you'll see it not receiving updates anymore, but, the socket is still valid. When it stops the BP in https://github.com/JKorf/CryptoExchange.Net/blob/5e0733d7f4788f7e8b342089934a168b05c4d9f8/CryptoExchange.Net/OrderBook/SymbolOrderBook.cs#L664, will not trigger anymore. Thanks! |
Description
After a random period of time, the IFactoryOrderBook service stops receiving updates. This issue seems to occur intermittently and does not follow a predictable pattern. It is critical for the proper functioning of our application that the IFactoryOrderBook service receives updates continuously without interruption.
Steps to Reproduce
Start the application.
Ensure that the IOrderBookFactory (IOKXOrderBookFactory, and IBybitOrderBookFactory) service is injected and ISymbolOrderBook instance has been created from the Factory.
Monitor the ISymbolOrderBook updates over a period of time.
Observe that after a random interval, the service stops receiving updates.
Expected Behavior
The IFactoryOrderBook service should continuously receive updates without any interruptions.
Actual Behavior
The ISymbolOrderBook service stops receiving updates after a random period of time.
there are no error logs or exceptions, it just does not raise the events anymore
I'm trying to listen to the Symbol Orderbook in Bybit and OKX.
The text was updated successfully, but these errors were encountered: