baidu / braft

An industrial-grade C++ implementation of RAFT consensus algorithm based on brpc, widely used inside Baidu to build highly-available distributed systems.
Apache License 2.0
3.99k stars 886 forks source link

结束节点后,进程依然打开log/log_xxx_xxx和log/log_inprogress_xxx文件,未关闭 #363

Closed hyj0 closed 2 years ago

hyj0 commented 2 years ago

具体是想要踢掉这个节点,调用Node::shutdown然后调用Node::join(),lsof查看进程依然打开log文件。请问下是这样正常的吗?

PFZheng commented 2 years ago

join结束了没?

hyj0 commented 2 years ago

join结束了没? 我们用rpc请求关闭node的, 调用如下 _node->shutdown(nullptr); _node->join(); , join返回了 这样有不对的地方吗?

PFZheng commented 2 years ago

调用没不对,哪儿感觉引用计数没到0

hyj0 commented 2 years ago

调用没不对,哪儿感觉引用计数没到0

_node析构时调用Release, 最终Segment析构才会释放 我们代码的问题, 没有delete _node导致fd没有释放