-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
TPL Dataflow's BufferBlock bug with OutputAvailableAsync after TryReceiveAll #13912
Comments
In SourceCore TryReceive turns on enableOffering to offer the next messages to any target (if there is one) while TryReceiveAll didn't. Fix #202
I just had this exact problem (I can translate from |
It shouldn't have. What build are you using? Can you share a repro? |
Hi @stephentoub , I'm using v4.5.24 of the My code is functionality equivalent to the Stephen Cleary example: https://blog.stephencleary.com/2012/11/async-producerconsumer-queue-using.html However, because I don't want my consumer to receive one message at a time, rather, to take all messages and process the batch. I am using the
|
I would actually much rather achieve this without the open-ended This way works because it is more of a "pull" action from the consumer, rather than a push action by the producer. |
That package is ancient, it was last updated in 2014, before this issue was fixed. You should instead use |
@svick Ah well that answers that riddle. Hadn't noticed the dates if I'm being honest, searched "dataflow" and it was the top result lol, ta. |
@stephentoub @svick Yeah that was it, thanks. Made the change back to the |
Great. Thanks for confirming. |
If you call
OutputAvailableAsync
afterTryReceiveAll
more than once you get back a task that never completes. No matter how many items are added to theBufferBlock
.The following sample reproduces the issue:
I have previously documented this bug in my stackoverflow question (BufferBlock deadlock with TryReceiveAll) and on VS connect (TPL Dataflow's BufferBlock possible deadlock with TryReceiveAll)
The text was updated successfully, but these errors were encountered: