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

Connection fail to disconnect keeps client grain alive #96

Open
stephenlautier opened this issue Sep 19, 2019 · 4 comments
Open

Connection fail to disconnect keeps client grain alive #96

stephenlautier opened this issue Sep 19, 2019 · 4 comments

Comments

@stephenlautier
Copy link
Contributor

stephenlautier commented Sep 19, 2019

Issue

If for some reason during disconnection theres a failure to handle ClientGrain.OnDisconnect it keeps throwing errors.

Scenario

  • Connection "A" connects to server "1x" (for User: "X")
  • Connection "A" disconnects
    • client.OnDisconnect disconnection fails
  • Connection "B" connects to server "1x" (for User: "X")
  • Message is send via user _hubContext.User("").Send("Echo");
    • Send to A (fails)
    • Send to B (success)

We end up with something as following:
image
(and a lot moreeee logs)

Suggestion

  • ClientGrain.Send fails to send x amount e.g. 5 (or configurable)
  • Force trigger OnDisconnect
  • Change log to Warning or even info "Client not connected for connectionId '{connectionId}' and hub '{hubName}'"

This way we will properly clean up ConnectionGrain's (user/group) from stale connections

As a side note, disconnection is still failing due to the extension not installed issue #89 :(
image

update: the specified scenario is not 100% as i thought, as i tried to reproduce locally by throwing on purpose in several areas but I never ended without serverId in that exact state

@luckyycode
Copy link

this is what I am struggling with now,

@luckyycode
Copy link

this happens when you shutdown any client ungracefully so it doesn't invoke OnDisconnect()

@luckyycode
Copy link

even Send/Invoke OneWay doesn't help to prevent this error, causes timeouts for us

@stephenlautier
Copy link
Contributor Author

@luckyycode which orleans version are you using?

If you want to give it a try we have a fork of this with several fixes (which are still not downmerged here) https://github.com/sketch7/SignalR.Orleans

https://github.com/sketch7/SignalR.Orleans/blob/1.x/CHANGELOG.md

If you do i suggest using 1.0.0-rc6 not the 2.x (but 1.x is for netcore 2 whilst 2.x is netcore3 however not updated with latest fixes). We are now using atm the 1.0.0-rc5 on production and its much more stable

Also fyi one of the reasons why its also causing errors/timeouts seems to be caused due to this dotnet/orleans#6161 (but there were other fixes in our fork which should help/fix)

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

No branches or pull requests

2 participants