Skip to content

Commit

Permalink
fix actor fails to recive batching messages if batchsize is less than…
Browse files Browse the repository at this point in the history
… the number of messages in the batchingMailbox because of dead loop
  • Loading branch information
wuuer committed Mar 14, 2024
1 parent 9791abb commit d3d8a23
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Proto.Actor/Mailbox/BatchingMailbox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ private async Task RunAsync()
{
batch.Clear();

while ((msg = _userMessages.Pop()) is not null ||
batch.Count >= _batchSize)
while (batch.Count < _batchSize &&
(msg = _userMessages.Pop()) is not null)
{
batch.Add(msg!);
}
Expand Down

0 comments on commit d3d8a23

Please sign in to comment.