Browse Source

conn_mgr: не удалять как stale кандидатов с активным соединением

v2
evgeny 3 weeks ago
parent
commit
c6118280bd
  1. 4
      src/routing_layer/conn_mgr_monitor.c

4
src/routing_layer/conn_mgr_monitor.c

@ -185,7 +185,9 @@ void cm_candidate_ping_timer_cb(void* arg) {
uint64_t nid = mgr->best_candidates[i].node_id;
struct TOPO_GROUP_NODE* nq = topo_node_find_by_id(mgr->group, nid);
if (!nq) { memmove(&mgr->best_candidates[i], &mgr->best_candidates[i+1], (--mgr->best_candidate_count - i) * sizeof(mgr->best_candidates[0])); i--; continue; }
if (cm_get_node_max_probe_time(nq) > 0 && (now - cm_get_node_max_probe_time(nq)) >= CONN_MGR_CANDIDATE_STALE_TB)
if (!cm_has_active_conn(mgr->group, nid)
&& cm_get_node_max_probe_time(nq) > 0
&& (now - cm_get_node_max_probe_time(nq)) >= CONN_MGR_CANDIDATE_STALE_TB)
{ DEBUG_INFO(DEBUG_CATEGORY_GENERAL, "conn_mgr: candidate 0x%016llx stale, removing", (unsigned long long)nid);
memmove(&mgr->best_candidates[i], &mgr->best_candidates[i+1], (--mgr->best_candidate_count - i) * sizeof(mgr->best_candidates[0])); i--; continue; }
if (cm_has_active_conn(mgr->group, nid)) {

Loading…
Cancel
Save