Details
-
Improvement
-
Status: Resolved
-
Critical
-
Resolution: Fixed
-
impala 2.3
-
None
Description
Our current spinlock implementation always busy spins. We've seen cases where this effectively causes priority inversion leading to very large lock wait times, e.g. IMPALA-3107.
We should switch to an adaptive spin-then-wait lock that first spins for a short time (in case the critical section is very short), and then automatically falls back to blocking. gutils has one that looks sane and I think as a bonus may keep contention stats.
Or we could see what the current version of boost/std mutex looks like. I think last we looked it always blocked which is why a custom SpinLock class was added.