Skip to content
This repository has been archived by the owner on Oct 12, 2023. It is now read-only.

The WebSocket is in an invalid state ('Aborted') for this operation #558

Open
ilya-git opened this issue Aug 20, 2018 · 3 comments
Open

Comments

@ilya-git
Copy link

ilya-git commented Aug 20, 2018

Actual Behavior

  1. I run the message loop with IMessageReceiver.RegisterMessageHandler
  2. In my logs I see sometimes (quite rare, but still) this exception that I log in a handler for unobserved task exception (TaskScheduler.UnobservedTaskException).

=== Exception ===
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. ---> System.Net.WebSockets.WebSocketException: The WebSocket is in an invalid state ('Aborted') for this operation. Valid states are: 'Open, CloseReceived'
at System.Net.WebSockets.WebSocket.ThrowOnInvalidState(WebSocketState state, WebSocketState[] validStates)
at System.Net.WebSockets.WebSocketBase.d__47.MoveNext()
--- End of inner exception stack trace ---
---> (Inner Exception #0) System.Net.WebSockets.WebSocketException (0x80004005): The WebSocket is in an invalid state ('Aborted') for this operation. Valid states are: 'Open, CloseReceived'
at System.Net.WebSockets.WebSocket.ThrowOnInvalidState(WebSocketState state, WebSocketState[] validStates)
at System.Net.WebSockets.WebSocketBase.d__47.MoveNext()<---

Expected Behavior

  1. Tasks should be observed in the library

Versions

  • OS platform and version: Windows 10
  • .NET Version: 4.6.2
  • NuGet package version or commit ID: 3.0.2

I am not 100% sure that this comes from the library, but the only other network operations I have is WCF which I have never seen to produce such an error. But I do suspect this happens after some network errors or something similar inside the library.

@nemakam
Copy link
Contributor

nemakam commented Sep 22, 2018

@ilya-git - Do you use web sockets with service bus client?
TransportType = TransportType.AmqpWebSockets?

@ilya-git
Copy link
Author

ilya-git commented Sep 22, 2018

Yes, I use AmqpWebSockets, thoughtI suppose default is same sockets as well, just another port (not 443).

@nemakam
Copy link
Contributor

nemakam commented Sep 24, 2018

The default doesn't go through "webSockets", just sockets :)
Wouldn't have received any exception from websocket code.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants