Skip to content
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

ObjectDisposedException in System.Net.WebSockets.ClientWebSocket #2245

Closed
jcondex opened this issue Jun 29, 2013 · 3 comments
Closed

ObjectDisposedException in System.Net.WebSockets.ClientWebSocket #2245

jcondex opened this issue Jun 29, 2013 · 3 comments
Assignees
Milestone

Comments

@jcondex
Copy link
Contributor

jcondex commented Jun 29, 2013

I got the following exception in our Peer2Peer scaleout scenario test using ServiceBus as the backplane.

The test ran on 2 machines with 1000 connections on each.

I don't know if this happens without scaleout, but from what I remember I have never seen it before.

System.AggregateException: One or more errors occurred. ---> System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'System.Net.WebSockets.ClientWebSocket'.
   at System.Net.WebSockets.ClientWebSocket.CloseOutputAsync(WebSocketCloseStatus closeStatus, String statusDescription, CancellationToken cancellationToken)
   at Microsoft.AspNet.SignalR.WebSockets.WebSocketHandler.<CloseAsync>b__2(Object state) in c:\Users\jconde\Documents\GitHub\SignalR\src\Microsoft.AspNet.SignalR.Core\Owin\WebSockets\WebSocketHandler.cs:line 104
   at Microsoft.AspNet.SignalR.Infrastructure.TaskQueue.<Enqueue>b__1(Func`2 next, Object nextState) in c:\Users\jconde\Documents\GitHub\SignalR\src\Microsoft.AspNet.SignalR.Core\Infrastructure\TaskQueue.cs:line 88
   at Microsoft.AspNet.SignalR.TaskAsyncHelper.FromMethod[T1,T2](Func`3 func, T1 arg1, T2 arg2) in c:\Users\jconde\Documents\GitHub\SignalR\src\Microsoft.AspNet.SignalR.Core\TaskAsyncHelper.cs:line 731
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at System.Threading.Tasks.Task.Wait()
   at SignalR.Stress.Scaleout.ServerBroadcastAll.Program.ConnectToOneOfTheHubsAndInvokeBroadcastAll() in c:\SignalR\Offcycle\WPT\SignalR\Main\stress\SignalR.Stress.Scaleout.ServerBroadcastAll\SignalR.Stress.Scaleout.ServerBroadcastAll\Program.cs:line 179
   at SignalR.Stress.Scaleout.ServerBroadcastAll.Program.BroadcastAll() in c:\SignalR\Offcycle\WPT\SignalR\Main\stress\SignalR.Stress.Scaleout.ServerBroadcastAll\SignalR.Stress.Scaleout.ServerBroadcastAll\Program.cs:line 118
   at Microsoft.Test.Stress.StressTest.MethodInvokerCache.Invoke(Object instance, MethodInfo method) in c:\Stress\src\Microsoft.Test.Stress\StressTest.cs:line 1156
   at Microsoft.Test.Stress.StressTest.InvokeMethod(Object instance, MethodInfo method, Int32 timeoutInSeconds) in c:\Stress\src\Microsoft.Test.Stress\StressTest.cs:line 602
   at Microsoft.Test.Stress.VariationInvoker.InvokeWithExtendedMetrics() in c:\Stress\src\Microsoft.Test.Stress\VariationInvoker.cs:line 156
   at Microsoft.Test.Stress.VariationInvoker.InvokeVariationMethod() in c:\Stress\src\Microsoft.Test.Stress\VariationInvoker.cs:line 145
   at Microsoft.Test.Stress.VariationInvoker.Invoke() in c:\Stress\src\Microsoft.Test.Stress\VariationInvoker.cs:line 97
   at Microsoft.Test.Stress.StressThreadRuntime.Run() in c:\Stress\src\Microsoft.Test.Stress\StressThreadRuntime.cs:line 101
   at Microsoft.Test.Stress.StressThreadRuntime.Execute() in c:\Stress\src\Microsoft.Test.Stress\StressThreadRuntime.cs:line 46
   at Microsoft.Test.Stress.StressTest.StressThreadProc(Object contextIdAndTimeToLiveTuple) in c:\Stress\src\Microsoft.Test.Stress\StressTest.cs:line 866
   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.Threading.ThreadHelper.ThreadStart(Object obj)
---> (Inner Exception #0) System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'System.Net.WebSockets.ClientWebSocket'.
   at System.Net.WebSockets.ClientWebSocket.CloseOutputAsync(WebSocketCloseStatus closeStatus, String statusDescription, CancellationToken cancellationToken)
   at Microsoft.AspNet.SignalR.WebSockets.WebSocketHandler.<CloseAsync>b__2(Object state) in c:\Users\jconde\Documents\GitHub\SignalR\src\Microsoft.AspNet.SignalR.Core\Owin\WebSockets\WebSocketHandler.cs:line 104
   at Microsoft.AspNet.SignalR.Infrastructure.TaskQueue.<Enqueue>b__1(Func`2 next, Object nextState) in c:\Users\jconde\Documents\GitHub\SignalR\src\Microsoft.AspNet.SignalR.Core\Infrastructure\TaskQueue.cs:line 88
   at Microsoft.AspNet.SignalR.TaskAsyncHelper.FromMethod[T1,T2](Func`3 func, T1 arg1, T2 arg2) in c:\Users\jconde\Documents\GitHub\SignalR\src\Microsoft.AspNet.SignalR.Core\TaskAsyncHelper.cs:line 731<---

@jcondex
Copy link
Contributor Author

jcondex commented Jul 23, 2013

I'm also seeing this in non-scaleout tests

@signalrcoreteam
Copy link

@jcondex Can you provide repro steps?

@ghost ghost assigned jcondex Aug 13, 2013
@davidfowl
Copy link
Member

@jcondex I'll assign this to you as well. Seems like your change to websockets fixes this as well.

@jcondex jcondex closed this as completed Aug 13, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants