"Cancelling Async Rust"
summary
Async Rust makes cancellation trivial because futures are passive and dropping them at any await point cancels child work; that causes real bugs: lost MPSC sends, invariant violations when awaiting while holding Tokio mutexes, and try_join/select canceling sibling shutdowns. Practical fixes used at Oxide include reserving channel slots, using write_all_buf for partial progress, pinning or spawning tasks so work runs to completion, and preferring an actor model over Tokio mutexes; these patterns reduce but do not eliminate cancellation failures.
AI-written summary · about
chapters (7)
- 0:00Introduction to Cancellation
- 13:06Analyzing Safety Concepts
- 17:47Tokio Mutex Hazards
- 21:13Common Cancellation Patterns
- 25:10Making Futures Safe
- 30:02Advanced Prevention Strategies
- 35:20Conclusion and Q&A








