Hi,
Maybe I'm misunderstanding how BlockingCollection works exactly, but I have the following piece of code:
if (!dataQueue.TryTake(out dataBuffer, timeout, cancellationToken))
{
if (!dataQueue.IsAddingCompleted)
{
throw new TimeoutException();
}
}
The idea is that if TryTake() returned false and CompleteAdding() has not been called yet, then it must have been a time-out. What we're seeing however is that sometimes TryTake() returns (almost) immediately (instead of waiting the timeout period) even
though IsAddingCompleted is false. Is there a scenario where this is expected to happen? We noticed it at first in cases where timeout was set to Timeout.Infinite, in case it makes a difference.
Regards,
Theodor