]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
msg/async: Don't dec(msgr_active_connections) if conn still in accepting_conns. 29836/head
authorJianpeng Ma <jianpeng.ma@intel.com>
Fri, 23 Aug 2019 06:15:43 +0000 (14:15 +0800)
committerJianpeng Ma <jianpeng.ma@intel.com>
Fri, 23 Aug 2019 06:15:43 +0000 (14:15 +0800)
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>
src/msg/async/AsyncMessenger.h

index 5c1c6ba397ec97ddb2c694f00a187e5c68f7f404..b7370cfc9d0ddb57071db1f14bfb5c937e806398 100644 (file)
@@ -403,7 +403,8 @@ public:
    */
   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) {