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 (#2105)
  • Loading branch information
wuuer authored Mar 16, 2024
1 parent 9791abb commit b41877b
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 b41877b

Please sign in to comment.