Closed bjqian closed 4 months ago
When the web app shuts down, due to the adhoc configured here : All the componets that are injected into the default resolver will be disposed. But the server connections are managed by serviceManager which doesn't dispose them :https://github.com/Azure/azure-signalr/blob/53f7d05d28bfb22cd46e5a39a558f6734800a1f9/src/Microsoft.Azure.SignalR.AspNet/ServerConnections/ServiceConnectionManager.cs#L136
In the example: https://github.com/Azure/azure-signalr/blob/53f7d05d28bfb22cd46e5a39a558f6734800a1f9/samples/AspNet.ChatSample/AspNet.ChatSample.SelfHostServer/Program.cs#L9 add a delay after the using of WebApp.Start. Press enter in cmd line to trigger dispose. Then the app server will get intp a stucking mode: The server connection is still alive but it will throw exception like "Cannot access a disposed object.Object name: 'LoggerFactory'.""}. when client connect event is triggered.
The fix is included in Release 1.26: https://github.com/Azure/azure-signalr/releases/tag/v1.26.0
Describe the bug
When the web app shuts down, due to the adhoc configured here : All the componets that are injected into the default resolver will be disposed. But the server connections are managed by serviceManager which doesn't dispose them :https://github.com/Azure/azure-signalr/blob/53f7d05d28bfb22cd46e5a39a558f6734800a1f9/src/Microsoft.Azure.SignalR.AspNet/ServerConnections/ServiceConnectionManager.cs#L136
To Reproduce
In the example: https://github.com/Azure/azure-signalr/blob/53f7d05d28bfb22cd46e5a39a558f6734800a1f9/samples/AspNet.ChatSample/AspNet.ChatSample.SelfHostServer/Program.cs#L9 add a delay after the using of WebApp.Start. Press enter in cmd line to trigger dispose. Then the app server will get intp a stucking mode: The server connection is still alive but it will throw exception like "Cannot access a disposed object.Object name: 'LoggerFactory'.""}. when client connect event is triggered.