-
-
Notifications
You must be signed in to change notification settings - Fork 422
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
Not handled ObjectDisposedException after disposing BinanceSocketClient #1082
Comments
Should be fixed in the latest version |
The same exception on 8.1.0 and CryptoExchange.Net 5.1.10. I suspect that socketConnection.CloseAsync is called from several places at the same time in my case (CheckTimeoutAsync also? ), but I don’t see any lock. |
I'm tried to call socketApi.UnsubscribeAllAsync() before call socketApi.Dispose but exception was the same. Library used disposed CancellationTokenSource . |
The problem isn't disposing socket API. ---> call UnsubscribeAllAsync --> unhandled exception from uncontrolled pool thread ----> dispose API ---> but application is crashed because unhandled exception |
Describe the bug
Not handled exception after disposing BinanceClient after upgrade to 8.0.13 from 8.0.11
To Reproduce
Dispose client in reconnecting state
Expected behavior
not handled exception will be handled
FATAL:UnhandledException: System.ObjectDisposedException: The CancellationTokenSource has been disposed.
at CryptoExchange.Net.Sockets.CryptoExchangeWebSocketClient.CloseInternalAsync()
at CryptoExchange.Net.Sockets.CryptoExchangeWebSocketClient.CloseAsync()
at CryptoExchange.Net.Sockets.SocketConnection.CloseAsync()
at CryptoExchange.Net.Sockets.SocketConnection.CloseAsync(SocketSubscription subscription)
at CryptoExchange.Net.BaseSocketClient.<>c_DisplayClass37_0
1.<<SubscribeAsync>b_0>d.MoveNext() — End of stack trace from previous location — at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__127_1(Object state) at System.Threading.QueueUserWorkItemCallback.Execute() at System.Threading.ThreadPoolWorkQueue.Dispatch() at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart() at CryptoExchange.Net.Sockets.CryptoExchangeWebSocketClient.CloseInternalAsync() at CryptoExchange.Net.Sockets.CryptoExchangeWebSocketClient.CloseAsync() at CryptoExchange.Net.Sockets.SocketConnection.CloseAsync() at CryptoExchange.Net.Sockets.SocketConnection.CloseAsync(SocketSubscription subscription) at CryptoExchange.Net.BaseSocketClient.<>c_DisplayClass37_0
1.<b_0>d.MoveNext()— End of stack trace from previous location —
at System.Threading.Tasks.Task.<>c.b__127_1(Object state)
at System.Threading.QueueUserWorkItemCallback.Execute()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()
The text was updated successfully, but these errors were encountered: