-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
tokio::sync::mpsc::bounded::Receiver<T>::is_empty() returns false when recv().await blocks #6594
Comments
saltatory
added
A-tokio
Area: The main tokio crate
C-bug
Category: This is a bug.
labels
May 28, 2024
Quick update: the same logic refactored to use |
Can you please provide more information? We have a fair number of tests on this: tokio/tokio/tests/sync_mpsc.rs Lines 1092 to 1151 in 9e00b26
If you're able to provide an example that displays the bug, then that would be very helpful. |
Closing as duplicate of #6602. Thank you for reporting this bug. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Version
Platform
Linux Seiza 6.8.0-31-generic #31-Ubuntu SMP PREEMPT_DYNAMIC Sat Apr 20 00:40:06 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Issue
TL;DR:
tokio:::sync::mpsc::bounded::Receiver<T>::is_empty()
returns false but when immediately followed bytokio::sync::mpsc::bounded::Receiver<T>::recv()
therecv()
blocks.I have a message-oriented IO library that is communicating with
io-uring
. Before I attempt to recv() IO messages on my channel, I check that bothio-uring
submission queue is not full and thatReceiver
is not empty before callingrecv().await
. Theis_empty()
call returns false but therecv()
blocks.The text was updated successfully, but these errors were encountered: