Join GitHub today
stats: reduce stats collecor's lock contention #9233
What problem does this PR solve?
We will create a session stats collector for each session and link them into a list. So when there are many sessions, it will take longer to loop the list, and holding the list head's lock during the whole process will block other operations, like
What is changed and how it works?
When looping the list, only holds the lock of necessary stats collector, that is the previous one and current. So it will only holds at most two locks at the same time.
@@ Coverage Diff @@ ## master #9233 +/- ## ========================================= - Coverage 67.3% 67.3% -0.01% ========================================= Files 373 373 Lines 78449 78441 -8 ========================================= - Hits 52803 52795 -8 + Misses 20911 20910 -1 - Partials 4735 4736 +1