Time based mutex poisoning

I've recently been asked what was an interesting bug I've run into during a project, and after discarding some boring ones (openssl failing on macos, correct utf8 parsing, 4 variables to set the same limit), I've remembered there was a more fun one. I've written a wrapper over std::collections::HashMap to make entries expirying, aka if I insert a value at t0 = 0s that expires in 5s: em.insert("key", "value", Duration::from_secs(5)) and then I try to get that value at t1 = 6s: ...

January 26, 2026 · 2 min · Nevalicjus