Abolish Lock Poisoning 0 ▲ Armin Ronacher's Thoughts and Writings 30 minutes ago · 7 min read1453 words · Tech · hide Rust has a curious feature that I don’t think the language would land today, if it was not there for a long time: mutex poisoning. When some Rust code panics while holding a std::sync::Mutex, the mutex is poisoned. That means that any further call to lock() returns a PoisonError. The motivation for this feature is that an object might have some internal invariants that need to be upheld and panicking in the wrong moment might invalidate reasonable at and leave an object behind in a broken state. Personally I absolutely hate this feature as it has bitten me so many times and I cannot once remember it helping me. The libs team is discussing making the non-poisoning locks the default in the next edition but entirely expectedly it has caused quite a few people to jump to the defence of the feature. In this post I want to make my personal case why poisoned locks should either be entirely removed or be made the exception. Primarily this is because I have yet to come across code in the wild… Commenting on Bubbles has been removed. Why? If you want to talk about this post, write to the author, use the comments on their blog if it has them, or reply with a "RE:" post on your own blog. Suggestions? feedback@bubbles.town