-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Closed
Labels
area-signalrIncludes: SignalR clients and serversIncludes: SignalR clients and serversbugThis issue describes a behavior which is not expected - a bug.This issue describes a behavior which is not expected - a bug.
Milestone
Description
Description
SignalR Core client used in WPF application throws an unhandled task exception if a connection was closed.
To Reproduce
Steps to reproduce the behavior:
- Using SignalR Core v1.1.0 on WPF .NET Framework 4.6.2
- Create HubConnection and connect to a server
- Stop server or block client so that it disconnects
- HubConnection is closed
- After GC has collected an unhandled task exception is raised
Expected behavior
HubConnection.Close containing an exception is fired. No additional exceptions are thrown, or at least not the ones that cannot be handled.
Stacktrace
There are multiple variants of an exception occuring. I can provide them if needed.
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. ---> WebSocketException: The 'System.Net.WebSockets.InternalClientWebSocket' instance cannot be used for communication because it has been transitioned into the 'Aborted' state. ---> WebSocketException: An internal WebSocket error occurred. Please see the innerException, if present, for more details. ---> IOException: Unable to read data from the transport connection: An established connection was aborted by the software in your host machine. ---> SocketException: An established connection was aborted by the software in your host machine
at System.Net.Sockets.Socket.EndReceive(IAsyncResult asyncResult)
at System.Net.Sockets.NetworkStream.EndRead(IAsyncResult asyncResult) --- End of inner exception stack trace ---
at System.Net.Security._SslStream.EndRead(IAsyncResult asyncResult)
at System.Net.TlsStream.EndRead(IAsyncResult asyncResult)
at System.Net.PooledStream.EndRead(IAsyncResult asyncResult)
at System.IO.Stream+<>c.<BeginEndReadAsync>b__43_1(Stream stream, IAsyncResult asyncResult)
at System.Threading.Tasks.TaskFactory`1+FromAsyncTrimPromise`1.Complete(TInstance thisRef, Func`3 endMethod, IAsyncResult asyncResult, Boolean requiresSynchronization)
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Net.WebSockets.WebSocketConnectionStream+<ReadAsync>d__21.MoveNext()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at System.Net.WebSockets.WebSocketBase+WebSocketOperation+<Process>d__19.MoveNext()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Net.WebSockets.WebSocketBase+<ReceiveAsyncCore>d__45.MoveNext() --- End of inner exception stack trace ---
at System.Net.WebSockets.WebSocketBase.ThrowIfAborted(Boolean aborted, Exception innerException)
at System.Net.WebSockets.WebSocketBase.ThrowIfConvertibleException(String methodName, Exception exception, CancellationToken cancellationToken, Boolean aborted)
at System.Net.WebSockets.WebSocketBase+<ReceiveAsyncCore>d__45.MoveNext()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.AspNetCore.Http.Connections.Client.Internal.WebSocketsTransport+<StartReceiving>d__19.MoveNext() --- End of inner exception stack trace ---
at System.Net.WebSockets.WebSocketBase.ThrowIfAborted(Boolean aborted, Exception innerException)
at System.Net.WebSockets.WebSocketBase.ThrowIfConvertibleException(String methodName, Exception exception, CancellationToken cancellationToken, Boolean aborted)
at System.Net.WebSockets.WebSocketBase+<ReceiveAsyncCore>d__45.MoveNext()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.AspNetCore.Http.Connections.Client.Internal.WebSocketsTransport+<StartReceiving>d__19.MoveNext() --- End of inner exception stack trace ---
at System.Threading.Tasks.TaskScheduler.PublishUnobservedTaskException(Object sender, UnobservedTaskExceptionEventArgs ueea)
at System.Threading.Tasks.TaskExceptionHolder.Finalize()
Metadata
Metadata
Assignees
Labels
area-signalrIncludes: SignalR clients and serversIncludes: SignalR clients and serversbugThis issue describes a behavior which is not expected - a bug.This issue describes a behavior which is not expected - a bug.