-
Notifications
You must be signed in to change notification settings - Fork 275
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
Unhandled "cannot access a disposed object" exception #141
Comments
Faced similar issue. Though I see a fix already applied for handling a disposed timer here - a4bcac3, |
Catched same exception in v0.15.2.11 |
me to |
Can also confirm. |
Same error here as well Cannot access a disposed object. at System.Threading.TimerQueueTimer.Change(UInt32 dueTime, UInt32 period) |
We are hitting this routinely during stress tests. Could it be caused by the double-checked locking on a non-volatile field used inside |
This seems to have happened seconds after the client handled a disconnect from the server.
The client had been running for about 2 hours already
I didn't delve in the source just yet but it looks like this may be solved just by checking if the timer is disposed
Here are the logs:
Cannot access a disposed object. at System.Threading.TimerQueueTimer.Change(UInt32 dueTime, UInt32 period)
at WebSocket4Net.WebSocket.ClearTimer()
at WebSocket4Net.WebSocket.FireClosed()
at WebSocket4Net.WebSocket.OnClosed()
at SuperSocket.ClientEngine.ClientSession.OnClosed()
at SuperSocket.ClientEngine.AsyncTcpSession.ProcessReceive(SocketAsyncEventArgs e)
at System.Net.Sockets.SocketAsyncEventArgs.OnCompleted(SocketAsyncEventArgs e)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Net.Sockets.SocketAsyncEventArgs.FinishOperationSuccess(SocketError socketError, Int32 bytesTransferred, SocketFlags flags)
at System.Net.Sockets.SocketAsyncEventArgs.CompletionPortCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)
at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)
The text was updated successfully, but these errors were encountered: