Somehow lock poisoning landed in Rust, and now people feel strongly that it helps. I really don't think it does and I collected some examples from the real world of why I think it should go: https://lucumr.pocoo.org/2026/11/25/poisoning/
@mitsuhiko I was reading this and thinking "actually I like this feature, but what I think I'd WANT it to do is—" and then you said it: keep poisoning but have lock() panic instead of returning a Result
Which you don't like LOL. Hm
@mitsuhiko I've actually never tried to recover from panics. If I imagine future use cases where I might, and I have one program where I really might, I imagine my goal would be to tear down all state from the panicked program, condense it into a sort of serialized form and then rebuild everything from scratch. I definitely wouldn't want locks surviving from one panic "epoch" to the next. I don't have an opinion about the best way for the API to let me police that but I want to police it.
@mcc If you build SaaS services with Rust, or you need to support long running processes for some other reasons panic handling is necessary. There is an alternative Rust hidden in Rust that does not panic, but returns results everywhere, and aborts only in extreme cases, but that flavor does not exist today to the best of my knowledge (outside of the Linux kernel).
@mitsuhiko I think if I were writing such a SaaS system I'd bend over backwards in the architecture to avoid the constant "processes must be long lived". It seems like if you can't migrate a client to a new process occasionally, then you can't migrate a client to a new *machine*, which you have to do occasionally. But I'm sure use-cases find a way to force architects to do things they don't want to do…
@mitsuhiko @mcc we are building SaaS services in rust with a result-everywhere style and deploying with panic=abort. Ideally I’d prefer to be able to statically assert that panics can never happen but we can eliminate them from our own code by enabling the right clippy lints.
@mitsuhiko Maybe this means that locks should not be allowed in Rust except with panic = "abort".
@xentrac In that world Rust is not a suitable language for high concurrent systems. We definitely wouldn't have been able to operate Sentry that way.
@mitsuhiko
Lock poisoning seems like a really good idea on paper.
But if it's not actually preventing problems in practice, then… 🤷♂️