Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upasync/await: Sending Waker seems to invalidate it #57036
Comments
Centril
added
the
A-async-await
label
Dec 21, 2018
This comment has been minimized.
This comment has been minimized.
This is unrelated to rust-lang/rust-- can you open an issue on the futures repository? |
cramertj
closed this
Dec 21, 2018
This comment has been minimized.
This comment has been minimized.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Janonard commentedDec 21, 2018
Hello everyone!
I recently started playing around with the new async/await features and wanted to implement a simple channel using the crossbeam channel and the new futures. The crossbeam channel itself isn't futures-aware, neither 0.1 futures nor the new ones, and therefore, I added another internal channel that sends wakers to the sender and when a new value is sent, the sender will wake all enqueued tasks.
My code is found in this repo: https://github.com/Janonard/rust-noopwake-bug
I expect the program to print
42
and then finish, which is often the case, but not always: Sometimes, I get an error sayingthread 'tokio-runtime-worker-2' panicked at 'NoopWake cannot wake'
(backtrace found here) and sometimes a simplethread 'tokio-runtime-worker-2' panicked at 'called 'Result::unwrap()' on an 'Err' value: ()'
(backtrace found here). Also, after panicing, the program hangs.Is this a bug within rust, tokio or crossbeam or have I simply made something wrong?
Meta
rustc --version --verbose
: