Yangfisher1 opened a new issue, #3065:
URL: https://github.com/apache/brpc/issues/3065
为了breakdown性能引入了bvar IntRecorder
bvar::IntRecorder g_latency_recorder("xxxx");
在向这个recorder写入数据的时候发生segfault,
g_latency_recorder << xxx;
通过gdb bt检查发现是IntRecorder的_combiner成员为空,
检查代码后发现只有这样创建IntRecorder时才会初始化_combiner, 否则是不会初始化的
bvar::IntRecorder g_latency_recorder;
``` cpp
IntRecorder() : _combiner(std::make_shared<combiner_type>()),
_sampler(NULL) {}
explicit IntRecorder(const butil::StringPiece& name) : _sampler(NULL) {
expose(name);
}
IntRecorder(const butil::StringPiece& prefix, const butil::StringPiece&
name)
: _sampler(NULL) {
expose_as(prefix, name);
}
```
请问一下这里剩下两个构造函数不初始化_combiner是什么原因呢, 是有专门的设计还是只是写漏了?
--
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]