You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Version Information
Version of Akka.NET? 1.4.28
Which Akka.NET Modules? Akka.Streams
Describe the bug
Hello, I am using Source.Queue(int.MaxValue, OverflowStrategy.DropNew) to create a queue that always accepts new items, but after enqueuing around 64 of them OfferAsync returns Dropped.
I investigated the source code and found that it uses FixedQueue and in its Enqueue method it checks if there are 16 elements (constant) and allocates a dynamic queue like this: var queue = new DynamicQueue(_head); The parameter _head has value of 64. I wonder if this is a bug and should be var queue = new DynamicQueue(Capacity); The problem is that queue IsFull returns _q.IsFull and since _q is now the DynamicQueue and its capacity is now 64 it returns true and the element is dropped.
To Reproduce
Steps to reproduce the behavior:
Create a queue with int.MaxValue limit: Source.Queue<int>(int.MaxValue, OverflowStrategy.DropNew)
Keep adding elements by calling await q.OfferAsync ...
Expect to get QueueOfferResult.Enqueued each time
Get QueueOfferResult.Dropped instead
Expected behavior
The queue should accept all items because of the high limit
Actual behavior
The queue still drops
Environment
GNU/Linux docker or local .net 6
The text was updated successfully, but these errors were encountered:
Version Information
Version of Akka.NET? 1.4.28
Which Akka.NET Modules? Akka.Streams
Describe the bug
Hello, I am using Source.Queue(int.MaxValue, OverflowStrategy.DropNew) to create a queue that always accepts new items, but after enqueuing around 64 of them OfferAsync returns Dropped.
I investigated the source code and found that it uses FixedQueue and in its Enqueue method it checks if there are 16 elements (constant) and allocates a dynamic queue like this: var queue = new DynamicQueue(_head); The parameter _head has value of 64. I wonder if this is a bug and should be var queue = new DynamicQueue(Capacity); The problem is that queue IsFull returns _q.IsFull and since _q is now the DynamicQueue and its capacity is now 64 it returns true and the element is dropped.
To Reproduce
Steps to reproduce the behavior:
Source.Queue<int>(int.MaxValue, OverflowStrategy.DropNew)
await q.OfferAsync ...
QueueOfferResult.Enqueued
each timeQueueOfferResult.Dropped
insteadExpected behavior
The queue should accept all items because of the high limit
Actual behavior
The queue still drops
Environment
GNU/Linux docker or local .net 6
The text was updated successfully, but these errors were encountered: