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

Fix DefaultResizer for suspended mailboxes (ReceiveAsync) #5333

Conversation

Arkatufus
Copy link
Contributor

Fixes #5327

Copy link
Member

@Aaronontheweb Aaronontheweb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some comments

@@ -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)
Copy link
Member

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()
Copy link
Member

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.

Copy link
Member

@Aaronontheweb Aaronontheweb left a 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

src/core/Akka/Routing/Resizer.cs Outdated Show resolved Hide resolved
@Aaronontheweb Aaronontheweb merged commit 347b2da into akkadotnet:dev Oct 21, 2021
@Arkatufus Arkatufus deleted the #5327_ReceiveAsync_breaks_DefaultResizer branch February 27, 2023 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DefaultResizer does not reisize when ReceiveAsync is used
2 participants