We have several clients connected to a server via signalr. Lately we found a strange behavior where it fails to deliver messages from server to clients after we have done a stop and start site from IIS. (Not stopping IIS itself, only the site). When stopping and starting from the IIS does not fire disconnect from the clients and signalr in built keepalive message keeps on going. Also we implemneted a similar keepalive method by yourself which returns a Boolean value, which also works even after IIS stop/start.
2017-04-19 08:55:28.0875 DEBUG [TID:20 TName:] 03:25:28.0875474 - 68e2ca39-9b7d-4652-904f-6fa53b0e616f - WS: OnMessage({})
(Util.SignalrTraceWriter.Write)
2017-04-19 08:55:38.0385 DEBUG [TID:19 TName:] 03:25:38.0385943 - 68e2ca39-9b7d-4652-904f-6fa53b0e616f - WS: OnMessage({})
(Util.SignalrTraceWriter.Write)
2017-04-19 08:55:48.0696 DEBUG [TID:20 TName:] 03:25:48.0696881 - 68e2ca39-9b7d-4652-904f-6fa53b0e616f - WS: OnMessage({})
(Util.SignalrTraceWriter.Write)
2017-04-19 08:55:58.1000 DEBUG [TID:19 TName:] 03:25:58.1000834 - 68e2ca39-9b7d-4652-904f-6fa53b0e616f - WS: OnMessage({})
(Util.SignalrTraceWriter.Write)
2017-04-19 08:55:59.2373 DEBUG [TID:20 TName:] 03:25:59.2373993 - 68e2ca39-9b7d-4652-904f-6fa53b0e616f - WS: OnMessage({"C":"d-F7251D27-B,0|C,8|D,0","M":[{"H":"ConnectorHub","M":"IsConnectionAlive","A":[true]}]})
(Util.SignalrTraceWriter.Write)
2017-04-19 08:55:59.2373 DEBUG [TID:20 TName:] 03:25:59.2384003 - 68e2ca39-9b7d-4652-904f-6fa53b0e616f - WS: OnMessage({"I":"21"})
(Util.SignalrTraceWriter.Write)
2017-04-19 08:56:08.1654 DEBUG [TID:13 TName:] 03:26:08.1654216 - 68e2ca39-9b7d-4652-904f-6fa53b0e616f - WS: OnMessage({})
(Util.SignalrTraceWriter.Write)
2017-04-19 08:56:18.0708 DEBUG [TID:20 TName:] 03:26:18.0708681 - 68e2ca39-9b7d-4652-904f-6fa53b0e616f - WS: OnMessage({})
(Util.SignalrTraceWriter.Write)
2017-04-19 08:56:28.2090 DEBUG [TID:13 TName:] 03:26:28.2090847 - 68e2ca39-9b7d-4652-904f-6fa53b0e616f - WS: OnMessage({})
(Util.SignalrTraceWriter.Write)
2017-04-19 08:56:38.1200 DEBUG [TID:20 TName:] 03:26:38.1200707 - 68e2ca39-9b7d-4652-904f-6fa53b0e616f - WS: OnMessage({})
(Util.SignalrTraceWriter.Write)
2017-04-19 08:56:48.2138 DEBUG [TID:13 TName:] 03:26:48.2138197 - 68e2ca39-9b7d-4652-904f-6fa53b0e616f - WS: OnMessage({})
(Util.SignalrTraceWriter.Write)
2017-04-19 08:56:58.2533 DEBUG [TID:20 TName:] 03:26:58.2533306 - 68e2ca39-9b7d-4652-904f-6fa53b0e616f - WS: OnMessage({})
(Util.SignalrTraceWriter.Write)
2017-04-19 08:57:08.4435 DEBUG [TID:13 TName:] 03:27:08.4435264 - 68e2ca39-9b7d-4652-904f-6fa53b0e616f - WS: OnMessage({})
(Util.SignalrTraceWriter.Write)
2017-04-19 08:57:18.2721 DEBUG [TID:20 TName:] 03:27:18.2721034 - 68e2ca39-9b7d-4652-904f-6fa53b0e616f - WS: OnMessage({})
(Util.SignalrTraceWriter.Write)
2017-04-19 08:57:28.4231 DEBUG [TID:13 TName:] 03:27:28.4231487 - 68e2ca39-9b7d-4652-904f-6fa53b0e616f - WS: OnMessage({})
In above trace IIS stop happens around 08:54:50 and start happens around 08:55:30. You can see that no disconnection is fired and both keepalive and method implemented by us communicate perfectly fine.
The issue is that after IIS stop/start messages that contains entities (defined by us) are failed to deliver. It tries to the same connection id that we are sending the IsConnectionAlive callback. But it never reaches the client. The difference between these both are the IsConnectionAlive only returns a boolean value as the parameter where other sends an entity as the parameter.
2017-04-19 08:56:41.5224 DEBUG SignalRHubHelper Sent job [192453] to Connector , connection id : 68e2ca39-9b7d-4652-904f-6fa53b0e616f (SignalRHubHelper)
The above is the log line from the server where it sends the entity.
Strangely we found that by enabling backplane (sql backplane) it manages to send messages with the entity even after IIS stop/start. Although there is a backplane there is no other servers connected to the backplane. What can be the cause for this behavior and what would be the case for not delivering messages after IIS stop/start with an entity.