I found this bug during test:
"AsyncMessenger::Worker-0": {
"msgr_active_connections":
18446744073709313353,
},
This because before AsyncMessenger::accept_conn, the conn met fault and
stop this conn. In unregister_conn, it will
dec(msgr_active_connections). But the conn it don't inc(msgr_active_connections).
Only erase from accepting_conns, it will inc(msgr_active_connections).
Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
*/
void unregister_conn(const AsyncConnectionRef& conn) {
std::lock_guard l{deleted_lock};
- conn->get_perf_counter()->dec(l_msgr_active_connections);
+ if (!accepting_conns.count(conn))
+ conn->get_perf_counter()->dec(l_msgr_active_connections);
deleted_conns.emplace(std::move(conn));
if (deleted_conns.size() >= ReapDeadConnectionThreshold) {