-
Notifications
You must be signed in to change notification settings - Fork 103
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
Cannot access disposed IServiceProvider on shutdown #1871
Comments
When the application shuts down and disposes IServiceProvider, HubConnectionHandler.RunHubAsync is still running and runs into _dispatcher.OnDisconnectedAsync, even with #1876, we will see error log ErrorDispatchingHubEvent from https://github.com/dotnet/aspnetcore/blob/main/src/SignalR/server/Core/src/HubConnectionHandler.cs#L229C12-L229C41. Hi @BrennanConroy, do you know how aspnetcore signalr avoid such issue when shutting down the application? In theory, it could also happen when not using Azure SignalR? |
It happens without ASRS as well. People haven't really complained about it though, so we haven't prioritized fixing it. |
So the issue is in baseline |
We fixed the error thrown from Azure SignalR SDK, but the fix for error thrown from inside the hub dispatcher depends on Microsoft.AspNetCore.SignalR. I am closing the issue here. |
Describe the bug
When being shut down, an ASP.NET Core app using Azure SignalR generates several errors:
Error count is less than 10% of the connection count at the time of shutdown, and appears to fluctuate slightly.
These do not appear to have any negative impact, except hindering our zero-error policy.
I am not sure whether this issue lies in baseline
Microsoft.AspNetCore.SignalR
, or in this library, and I would be grateful if you'd help me find out and route my issue to appropriate place. I would gladly provide any additional debug information to help.Further technical details
The text was updated successfully, but these errors were encountered: