lintanghui opened a new issue, #3069:
URL: https://github.com/apache/brpc/issues/3069
**Describe the bug**
clear_stats不是线程安全的,在一个线程周周期执行clear_stats用于情况mvar指标,其他线程不停执行get_stats();然后进行赋值会导致coredump
**To Reproduce**
```
bvar::MultiDimension<bvar::LatencyRecorder> mvar("mvar", {"label1",
"label2"});
std::list<std::string> lables = {"v1", "v2"};
bvar::LatencyRecorder* rec = mvar.get_stats(lables);
// 实际clear_stats是在别的线程执行,处理用于模拟并发操作的情况快速复现
mvar.clear_stats();
*rec << 100;
```
**Expected behavior**
**Versions**
OS:
Compiler:
brpc:
protobuf:
**Additional context/screenshots**
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]