-
Notifications
You must be signed in to change notification settings - Fork 1k
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
NullReferenceException in Akka.Util.Internal.Collections.ImmutableAvlTreeBase`2.RotateLeft #1202
Comments
Putting some red labels on this one - smells like a potential bug to me. Mind if I ask some additional questions?
|
Sure.
The receive method itself is synchronous, but we use
Yeah. Hundred or two. They are constantly adding and removing over time. Also they have there own children, that also can be added or removed.
No, definitely not. This system was functioning for relatively long time, and that was the first and only time we faced this exception. |
Related to #1175 , we plan to replace the AVL tree to a Red/Black tree as the JVM impl |
Ok, thanks. |
I'm facing the same sporadically, usually over a 100 actors. My actor behaves a bit as @kantora, constantly adding and removing children. Had it happen three times yesterday at startup of my system, and then it stopped. So it's highly random, probably depends on the order things are added/removed. |
Changed fix for better consistency/comparability with the code just above
For us this bug is critical. Our application makes a lot of temporary actors, and every single run it would crash (at random times, but always within a minute or two). |
Root cause here is a bug in the ImmutableAvlTreeBase: Remove could return an unbalanced (height difference >1) tree node. When adding something below this, it auto-resolves. When adding something 'next' to this node, in some cases this would lead to the exception. All about the exact order in which keys are added/removed to the tree. |
Is there a reason that we're not using the BCL ImmutableDictionary here? It is standard now and is also an immutable AVL tree. Performance reasons? |
I tend to agree to try and use an 'off the shelf' implementation; this is not at all specific / core business to akka.net . |
@mattnischan back in the day when we discussed this, I dont think anyone of us knew that the immutable dict was an AVL tree. (#472) If the ImmutableDictionary can be used instead, I definitely think we should replace the custom code with that. |
What about the other talk about using a red-black tree? There is a issue
|
The performance differences between red-black and AVL are extremely slight and very use-case dependent. AVL is slightly better for reads due to more strict balance (less depth), and red-black slightly better for inserts due to fewer rotations. However, the rules for red-black rotations are slightly more expensive, so in mixed use scenarios (which these appear to be), I don't see a reason to favor one over the other. |
Changed fix for better consistency/comparability with the code just above Added unit test for 2 types of removals that used to return an unbalanced tree.
Changed fix for better consistency/comparability with the code just above
Hello.
We've got strange error in our application.
I'll just post StackTrace here.
GetOrCreateChild methods just creats child actor like this:
Nither this.OrderGenerator nor childName could be null in this case (I've checked this several times).
But this only happened once this far...
The text was updated successfully, but these errors were encountered: