Azure / azure-signalr

Azure SignalR Service SDK for .NET
https://aka.ms/signalr-service
MIT License
425 stars 100 forks source link

Check Server connection state #588

Open joaomatossilva opened 5 years ago

joaomatossilva commented 5 years ago

Hello,

In order to make a server health check I was wondering if it's possible to check if the status of the server connection to the Azure.

The IServiceConnection does expose those properties, but the interface (as well as implementations) are internal.

Do we have any depedency that is registered on the IServiceCollection that we can query for a server connection status, like number of active connections orso.

unsafecode commented 5 years ago

Same here, we often get The connection is not active, data cannot be sent to the service in the logs, but SDK does not fail, and health probes are useless then.

/cc @ruoccofabrizio

zackliu commented 5 years ago

If all the server connections are in disconnected state, you can definitely catch exceptions when calling method like await Clients.All.SendAsync(). In some cases, you get a lot of logs like The connection is not active, data cannot be sent to the service, but there's no exception when you call await Clients.All.SendAsync(). It happened when a server connection dropped but failed to clean up all the underlayer resources. It doesn't mean your server is in an unhealthy state, and you can still send messages successfully. We're going to release a new SDK to resolve the problem. What's more, according to our tests, if there're some hub methods that never end (while true loop or hung), you will get these problems. So you can also check your hub method about it.

joaomatossilva commented 5 years ago

We have a multi-server setup. But we wan't to check the health of each server during the individual deploy process, because we want to troubleshoot firewall issues on each instance.

Will the new SDK be able to make that check? Will it be able to run on the aspnet core 2.1 or are we forced to upgrade to 2.2 or even 3.0?