OrleansContrib / SignalR.Orleans

SignalR backend based on Orleans.
MIT License
295 stars 64 forks source link

Connection fail to disconnect keeps client grain alive #96

Open stephenlautier opened 5 years ago

stephenlautier commented 5 years ago

Issue

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

Scenario

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

Suggestion

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 https://github.com/OrleansContrib/SignalR.Orleans/issues/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 commented 4 years ago

this is what I am struggling with now,

luckyycode commented 4 years ago

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

luckyycode commented 4 years ago

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

stephenlautier commented 4 years ago

@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 https://github.com/dotnet/orleans/issues/6161 (but there were other fixes in our fork which should help/fix)