-
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
Fix DefaultResizer for suspended mailboxes (ReceiveAsync) #5333
Fix DefaultResizer for suspended mailboxes (ReceiveAsync) #5333
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some comments
src/core/Akka/Routing/Resizer.cs
Outdated
@@ -226,6 +226,9 @@ public int Pressure(IEnumerable<Routee> currentRoutees) | |||
var underlying = actorRef.Underlying; | |||
if (underlying is ActorCell cell) | |||
{ | |||
if (cell.Mailbox.IsSuspended() && cell.Mailbox.NumberOfMessages >= PressureThreshold) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks right to me
@@ -266,6 +285,55 @@ public void DefaultResizer_must_grow_as_needed_under_pressure() | |||
RouteeSize(router).Should().Be(resizer.UpperBound); | |||
} | |||
|
|||
[Fact] | |||
public async Task DefaultResizer_with_ReceiveAsync_must_grow_as_needed_under_pressure() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does this test perform? Resizer
specs are notoriously racy, but if we force the Resizer
to spin up more actors while the current ones are await
-ing over a sufficiently long duration that should be reasonably stable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - discussed this @Arkatufus
…:Arkatufus/akka.net into #5327_ReceiveAsync_breaks_DefaultResizer
Fixes #5327