tokio mpsc channel deadlock after a while even with one producer – one consumer
I am trying to use tokio::sync::mpsc::channel
for communication between Repository and Controller. However, after a few message change, sender is blocked on the .send
because the buffer is full and the receiver reads 2 more messages after that and waits for a new message. The problem is that the sender doesn’t get unblocked so they both are hanging.
Containerized asynchronous Rust app crashing on `tokio::runtime::Runtime::block_on`
When using my Rust App contanerized, the block_on
function from tokio::runtime
crashes:
Does the use of `std::sync::Mutex` across `await` point ALWAYS cause deadlock?
Though I have read all of the OP, the answer and the comments of Why do I get a deadlock when using Tokio with a std::sync::Mutex?, I don’t yet understand why the code in the OP blocks forever.