Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unhandleable exceptions when connecting #710

Open
AdamFrisby opened this issue Oct 30, 2023 · 1 comment
Open

Unhandleable exceptions when connecting #710

AdamFrisby opened this issue Oct 30, 2023 · 1 comment

Comments

@AdamFrisby
Copy link

StreamingHubClientBase.cs has multiple locations where it traps exceptions, and by default, silently eats them; preventing them being handled appropriately.

StartSubscribe() (line circa 139 and circa 161) can receive RpcExceptions and other faults when a connection fails; however due to it silently eating these at this point, it becomes impossible to know whether a connection is alive or dead; particularly in the case of a unidirectional StreamingHub where the client only receives messages from the server.

This is compounded by NullLogger being the default, which eats the log messages informing of the fault, leading to an undetectable state where a connection has failed, but no errors are reported.

@mayuki
Copy link
Member

mayuki commented Jan 11, 2024

Whether a StreamingHub connection has been established can be determined by whether ConnectAsync throws an exception. If the connection is disconnected while receiving a message, you can handle it by waiting for WaitForDisconnect.

When an exception thrown by await moveNext (in StartSubscribe) are caught, the subscription is stopped and signalled to WaitForDisconnect.

We are considering passing the cause of the error to WaitForDisconnect. Would that be insufficient?

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

No branches or pull requests

2 participants