binance / binance/binance-futures-connector-java
WebSocket Connection State / Error on new connection for UMWebsocketClientImpl
- Dominant language
- Java
- Stars
- 191
- Forks
- 96
- PR merge metrics
- No merged PRs in 30d
Description
We have no any information about the connection state for the UMWebsocketClientImpl.
According to the description (https://binance-docs.github.io/apidocs/futures/en/#websocket-market-streams) all web sockets might be closed in 24 hours.
Even if we try to make new instance of the class UMWebsocketClientImpl we will receive the following error:
[BINANCE_STREAMS_MANAGER] ERROR com.binance.connector.futures.client.utils.WebSocketConnection - [Connection 6] Failure
java.io.InterruptedIOException: executor rejected
at okhttp3.internal.connection.RealCall$AsyncCall.executeOn(RealCall.kt:501)
at okhttp3.Dispatcher.promoteAndExecute(Dispatcher.kt:184)
at okhttp3.Dispatcher.enqueue$okhttp(Dispatcher.kt:125)
at okhttp3.internal.connection.RealCall.enqueue(RealCall.kt:164)
at okhttp3.internal.ws.RealWebSocket.connect(RealWebSocket.kt:165)
at okhttp3.OkHttpClient.newWebSocket(OkHttpClient.kt:281)
at com.binance.connector.futures.client.utils.WebSocketConnection.connect(WebSocketConnection.java:52)
at com.binance.connector.futures.client.impl.WebsocketClientImpl.createConnection(WebsocketClientImpl.java:719)
at com.binance.connector.futures.client.impl.WebsocketClientImpl.klineStream(WebsocketClientImpl.java:167)
at com.binance.connector.futures.client.impl.WebsocketClientImpl.klineStream(WebsocketClientImpl.java:149)
Steps to reproduce:
UMWebsocketClientImpl client = new UMWebsocketClientImpl();
client.klineStream();
client.closeAllConnections();
Thread.sleep(5000); //We should wait some time here because the method is not sync if I understood correctly
client = new UMWebsocketClientImpl();
client.klineStream(); //Error here
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with WebSocketConnection.java and WebsocketClientImpl.java, following createConnection, closeAllConnections, and klineStream in the stack trace. Reproduce the sequence of creating a client, opening a stream, closing all connections, waiting, and creating a new client. Done means the connection lifecycle is observable and a new stream does not fail with executor rejected.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api, networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100