We have a complex web application that uses SignalR to communicate with clients sending them updates about video encoders. It sends them snapshots of camera images, status of recordings, schedule information of the record, etc every few seconds.
Now from time to time the Application is recycled after the following exception in the routine which fetches the information from the encoder and pushes it to the subscribed clients:
Core.Assemblers.ScheduleAssembler,Error,GetRecordingInfo failed,"System.Net.Http.HttpRequestException: Response status code does not indicate success: 503 (Service Unavailable).
at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
at Core.Clients.EncoderClient.<Request>d__25.MoveNext() in e:\jenkins\workspace\sources\Core\Clients\EncoderClient.cs:line 241
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Core.Clients.EncoderClient.<GetRecordingInfo>d__20.MoveNext() in e:\jenkins\workspace\sources\Core\Clients\EncoderClient.cs:line 162
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Core.Services.EncoderInfoService.<TryGetClientInfo>d__22.MoveNext() in e:\jenkins\workspace\sources\Services\EncoderInfoService.cs:line 272"~
I'm not certain if threads from SignalR are associated with a Request or not. If not than this exception would tear down the application and explain why the pool is recycled at that time.
In this article it is confirmed that the application pool is recycled after an exception that is not tied to a Reqeust.
My question is. Is this the cause of the pool recycling?