Open UndefinedSy opened 3 months ago
5932
when continuously adding new labels to statsManager's nameMap, one may crash on using the previously returned iterator from nameMap.
using read lock to protect the iterator returned from sm.nameMap_, which is a std::unordered_map.
process will not crash on using statsManager.
Tests:
Affects:
Fixed the bug that process crashes on concurrent accessing stats manager's nameMap_.
What type of PR is this?
What problem(s) does this PR solve?
Issue(s) number:
5932
Description:
when continuously adding new labels to statsManager's nameMap, one may crash on using the previously returned iterator from nameMap.
How do you solve it?
using read lock to protect the iterator returned from sm.nameMap_, which is a std::unordered_map.
Special notes for your reviewer, ex. impact of this fix, design document, etc:
process will not crash on using statsManager.
Checklist:
Tests:
Affects:
Release notes:
Fixed the bug that process crashes on concurrent accessing stats manager's nameMap_.