Hacker News new | ask | show | jobs
by renehsz 10 days ago
IMO Mutex poisoning is a symptom of the unfortunate decision to unwind panics by default, instead of the much more sane panic="abort".

There are two kinds of errors: Those that you expect to happen in production and should therefore be handled explicitly. And those that should never happen in production and should therefore simply crash the process.

Any sufficiently important production system needs to be able to recover from process crashes anyway (all code runs on physical hardware after all, so in rare instances it could crash despite your code being 100% correct).

If you decide to also try to recover from panics, that introduces another failure recovery mechanism that adds complexity despite being largely redundant. It's easy to get wrong, extremely cumbersome to test and verify, etc.

There can be many unfortunate consequences of the deeply misguided idea of unwinding panics and, worse still, attempting to recover from them, mutex poisoning is just one of them.