Repository navigation
Move to parking_lot::Mutex in logins, places and sync_manager - #4663
Conversation
1772fff to
9ef3a7e
Compare
|
I think I agree with this change, but before landing this, I wonder if we can audit our That all said, I'm thinking if we CAN audit our panics extensively then we wouldn't have ended up in the situation we are in (where poison errors keep popping up..) This is a long way for rubberstamping on my end if we can't think of any situations where the poison is better 🤷 |
|
Agree with @tarikeshaq's sentiments. Worse case scenario the poison errors are reported as elusive panics in Sentry, but at least that gets us closer to identifying what caused the invalid state and resolving the crashes. Best case the actual issues are easy to identify and resolve. Either way, nervous but r+. |
I don't think we can in any reasonable way. Eg, the 2 issues linked above are clearly logic errors that should be impossible. We could replace those 2 instances with errors, but I don't think that solves the general whack-a-mole problem. One is an "index out of range" error - I don't think it makes sense to try and have a coding style that forbids IOW, the point of this patch is about making panics less damaging, making it less necessary to try and avoid panics at all costs.
Actually, I think the opposite it true - for every panic, you are likely to see that cause many poison errors - eg, once there is a single panic in logins, every single other attempt to use the logins API will cause the poison panic, which might be dozens of times before the app restarts. The poison errors carry no information about the panic, so these errors are just noise which drown out the actual panic which set off the cascading poison errors. |
Codecov Report
@@ Coverage Diff @@
## main #4663 +/- ##
=======================================
Coverage 80.55% 80.55%
=======================================
Files 48 48
Lines 5226 5226
=======================================
Hits 4210 4210
Misses 1016 1016 Continue to review full report at Codecov.
|
19020be to
0be511d
Compare
bendk
left a comment
There was a problem hiding this comment.
Seems good to me based on the discussion we had on the call. There's a part of me that's still a bit paranoid about panics, but I can't really think of a solid case for it.
0be511d to
2313515
Compare
Avoiding panics in all cases, like #4661 and #4662, is going to be whack-a-mole, and when one happens, we pollute sentry with many many
Caught a panic calling rust code: "called `Result::unwrap()` on an `Err` value: PoisonError { .. }"errors.I don't think we rely on the poisoning strategy for correctness, so we should consider moving to parking_lot.
(Not requesting review yet - I think we should discuss a little - so thoughts welcome!)