Oriel — AI & technology worth noticing, every day.

Abolish Lock Poisoning

Web page · https://lucumr.pocoo.org/2026/11/25/poisoning

First seen by Oriel on .

AI summary

The author argues Rust should make non-poisoning mutexes the default, claiming poisoning commonly causes deadlocks and cascading outages while rarely enabling correct recovery.

  • A poisoned lock returns a `PoisonError` that owns the guard, so error propagation or conditional handling can keep the mutex locked and cause deadlocks.
  • Calling `lock().unwrap()` on a poisoned mutex can turn one panic into repeated failures across request handlers, tasks, and test suites.
  • Recovery with `into_inner()` leaves the poison flag set unless code clears it, potentially repeating recovery work or warnings on every access.
  • The author cites standard-library code and libraries including Tokio, Wasmtime, and crossbeam-channel that ignore poisoning or use non-poisoning locks.
  • The proposal is to default `std::sync::Mutex` to non-poisoning and offer an opt-in `Poison<T>` wrapper; the author opposes making `lock()` panic on poison.

#rust #mutexes #panic handling #concurrency

Generated by gpt-5.6-sol. Check the original for details.

Metric trends

Last 30 days · Up to 120 recorded samples per source and metric, with reposts kept separate · First and latest retained

Points

Score reported by the source.

  • Lobsters: 54, latest observation ; +53 over observed period since

Comments

Comment count reported by the source.

  • Lobsters: 76, latest observation ; +76 over observed period since

Aliases

SourceExternal IDURL
Lobsterssj2pkvhttps://lucumr.pocoo.org/2026/11/25/poisoning/ Read discussion