From: Jianpeng Ma Date: Tue, 31 Dec 2019 02:20:16 +0000 (+0800) Subject: msg/async: dec(l_msgr_active_connections) when unregister anonymous connection X-Git-Tag: v15.1.0~319^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=550c447ad890f245b449afc4c7cb25dc59f00e23;p=ceph.git msg/async: dec(l_msgr_active_connections) when unregister anonymous connection When do all in one test, l_msgr_active_connection don't decrease when client shutdown. This bug introduced by 5b41e12fdb445. Signed-off-by: Jianpeng Ma --- diff --git a/src/msg/async/AsyncMessenger.h b/src/msg/async/AsyncMessenger.h index cd8ad3c8b83..6e18281f1b9 100644 --- a/src/msg/async/AsyncMessenger.h +++ b/src/msg/async/AsyncMessenger.h @@ -397,7 +397,7 @@ public: */ void unregister_conn(const AsyncConnectionRef& conn) { std::lock_guard l{deleted_lock}; - if (!accepting_conns.count(conn)) + if (!accepting_conns.count(conn) || anon_conns.count(conn)) conn->get_perf_counter()->dec(l_msgr_active_connections); deleted_conns.emplace(std::move(conn)); conn->unregister();