Skip to content
This repository was archived by the owner on Dec 18, 2018. It is now read-only.

HubConnection hangs if parsing a hub message throws #816

Closed
moozzyk opened this issue Sep 2, 2017 · 3 comments
Closed

HubConnection hangs if parsing a hub message throws #816

moozzyk opened this issue Sep 2, 2017 · 3 comments

Comments

@moozzyk
Copy link
Contributor

moozzyk commented Sep 2, 2017

If parsing a hub message on the client side throws (e.g. due to invalid number of parameters) may hang forever. This may happen if client is awaiting for a completion message but a previous client side method invocation threw. This is because if a task in the task queue throws the queue will not schedule a new task.

We should at the hub connection level:

  • handle cases where it is easy to make a mistake (invalid parameter count or mismatched type)
  • in case of legitimate exceptions (e.g. invalid format) - close the connection

At the http connection level:

  • Close the connection if an exception is throw from the a queued task - nothing else can be queued if the queue ends up in this state

EDIT

Actually we should catch exceptions from users code and log. Only exceptions from parsing should result in closing the connection.

@moozzyk
Copy link
Contributor Author

moozzyk commented Sep 7, 2017

This is partially fixed - hangs due to spoiled event queue (at the HttpConnection level) should no longer occur. At the hub level we need to make sure that if we receive a message and we cannot process it we will complete a corresponding invocation/tcs as long as we can read the invocation id from the message.

@davidfowl
Copy link
Member

I'll do this as the client refactor

@davidfowl
Copy link
Member

davidfowl commented Feb 21, 2018

#1475

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

No branches or pull requests

2 participants