-
Notifications
You must be signed in to change notification settings - Fork 2k
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
ObserverManager needs a ConcurrentDictionary #9242
Comments
Are you able to share some code? This doesn't seem right - there should be no concurrent modifications. Is it 8.2.0+ or earlier? Changing the impl to use concurrent dictionary is ok, but I'd like to make sure we understand the cause first. |
Orleans 8.2.0 So I have a Speed Trap system that contains a UnitGrain that accepts an image frame (from camera stream) when a violation happens and publishes it to all observers. The observers list changes constantly as users jump in and out of the system, which provides realtime alerts when violations occur. So I imagine if a user hop in or out of the system while ObserverManager is iterating the Code is as follows: People subscribe in a Signalr Hub:
That then goes to the Grain:
The Unsubscribe happens the same way but it also autounsubscribes when a WebSocket connection dies.
The UnitObserver itself looks like this:
And the way we notify all observers is just one line:
|
Is reentrancy involved anywhere? |
No reentrancy in the entire codebase |
👀 |
We keep getting errors like this in a high client density deployment:
It seems like an easy fix that we would love to see in Orleans 8.x. Please change the field
_observers
toConcurrentDictionary<>
.cc @ReubenBond
The text was updated successfully, but these errors were encountered: