ldout(cct, 20) << __func__ << " destructing rdma dispatcher" << dendl;
assert(qp_conns.empty());
+ assert(num_qp_conn == 0);
assert(dead_queue_pairs.empty());
assert(num_dead_queue_pair == 0);
--num_dead_queue_pair;
}
}
- if (done)
+ if (!num_qp_conn && done)
break;
if ((ceph_clock_now() - last_inactive).to_nsec() / 1000 > cct->_conf->ms_async_rdma_polling_us) {
Mutex::Locker l(lock);
assert(!qp_conns.count(qp->get_local_qp_number()));
qp_conns[qp->get_local_qp_number()] = std::make_pair(qp, csi);
+ ++num_qp_conn;
return fd;
}
++num_dead_queue_pair;
dead_queue_pairs.push_back(it->second.first);
qp_conns.erase(it);
+ --num_qp_conn;
}
void RDMADispatcher::handle_pre_fork()
EventCallbackRef async_handler;
bool done = false;
std::atomic<uint64_t> num_dead_queue_pair = {0};
+ std::atomic<uint64_t> num_qp_conn = {0};
Mutex lock; // protect `qp_conns`, `dead_queue_pairs`
// qp_num -> InfRcConnection
// The main usage of `qp_conns` is looking up connection by qp_num,