What happens on server when SSE connections lost?

Recently we implemented SSE. Since then, we’ve also noticed an exception that occurs 1000’s of times a day. We suspect it’s some with SSE and possibly lost communication to clients, but what to try and clarify.

Here is the exception that we capture via BugSnag

System.AggregateException · A Task's exception(s) were not observed either by Waiting on the Task or accessing its 
Exception property. As a result, the unobserved exception was rethrown by the finalizer thread.
Bugsnag.UnhandledException.HandleEvent(Exception exception, bool runtimeEnding)	
System.EventHandler<TEventArgs>.Invoke(object sender, TEventArgs e)	
System.Threading.Tasks.TaskScheduler.PublishUnobservedTaskException(object sender, 
UnobservedTaskExceptionEventArgs ueea)	
System.Threading.Tasks.TaskExceptionHolder.Finalize()	
Caused By: System.Web.HttpException · The remote host closed the connection. The error code is 0x800704CD.
System.Web.Hosting.IIS7WorkerRequest.RaiseCommunicationError(int result, bool throwOnDisconnect)	
System.Web.Hosting.IIS7WorkerRequest.ExplicitFlush()	
System.Web.HttpResponse.Flush(bool finalFlush, bool async)	
System.Web.HttpWriter.WriteFromStream(byte[] data, int offset, int size)	
System.IO.Stream+<>c.<BeginWriteInternal>b__46_0(object )	
System.Threading.Tasks.Task<TResult>.InnerInvoke()	
System.Threading.Tasks.Task.Execute()	
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()	
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)	
System.IO.Stream.EndWrite(IAsyncResult asyncResult)	
System.IO.Stream+<>c.<BeginEndWriteAsync>b__53_1(Stream stream, IAsyncResult asyncResult)	
System.Threading.Tasks.TaskFactory<TResult>+FromAsyncTrimPromise<TInstance>.Complete(TInstance thisRef, 
Func<T1, T2, TResult> endMethod, IAsyncResult asyncResult, bool requiresSynchronization)

Does this appear to be possibly related or are we totally off base here?

Where’s the reference to Server Events? The StackTrace suggests you have an Unobserved Task Exception.

See this StackOverflow answer for registering a UnobservedTaskException handler.

There isn’t - that’s why I was shooting in the dark here. We can’t see where it would be coming from otherwise especially given the number of errors an hour. But thanks for the link. We will see if that can scratch up some additional information for us.