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
Describe the bug
clear_stats不是线程安全的,在一个线程周周期执行clear_stats用于情况mvar指标,其他线程不停执行get_stats();然后进行赋值会导致coredump
To Reproduce
Expected behavior
Versions
OS:
Compiler:
brpc:
protobuf:
Additional context/screenshots