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

6.0.1 - System.ObjectDisposedException (SendWebSocketMessageAsync) #597

Open
stbjin opened this issue Oct 5, 2023 · 1 comment
Open

Comments

@stbjin
Copy link

stbjin commented Oct 5, 2023

My app suddenly went boom along with the following exception. Not entirely sure how/where to properly catch it.
Most probably during sending a Pong ( my app never actively send anything itself, only runs a subscription and receive events )

Description: The process was terminated due to an unhandled exception.
Exception Info: System.ObjectDisposedException
at System.Net.WebSockets.WebSocketBase.ThrowIfDisposed()
at System.Net.WebSockets.WebSocketBase+WebSocketOperation+d__19.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)
at System.Net.WebSockets.WebSocketBase+d__47.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)
at GraphQL.Client.Http.Websocket.GraphQLHttpWebSocket+d__39.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)
at GraphQL.Client.Http.Websocket.GraphQLHttpWebSocket+d__38.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)
at GraphQL.Client.Http.Websocket.GraphQLTransportWSProtocolHandler+<>c__DisplayClass7_1`1+<b__2>d[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()

@stbjin
Copy link
Author

stbjin commented Oct 6, 2023

I've just had another app crash of the same type and this time around I noticed it happened sometime around when the graphClient was restarted, which happens when the access token gets renewed ( typically once every hour ). This access token is sent in the init() phase and needs to be updated on expiry. So to accomplish this I simply dispose the running client and it's subscriptions ( events, ws state and ws exceptions ), and set it all up again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant