fix crash at node replacement
@@ -142,7 +142,6 @@ conn_pool_get(conn_pool_t *cp, int tag)
rstatus_t
conn_pool_destroy(conn_pool_t *cp)
{
- cp->scheduled_reconnect_task = NULL;
uint8_t idx = 0;
uint32_t count = array_n(&cp->active_connections);
for (idx = 0; idx < count; idx++) {
@@ -159,6 +158,7 @@ conn_pool_destroy(conn_pool_t *cp)
log_notice("%s %s Cancelling task %p", print_obj(cp->owner), print_obj(cp),
cp->scheduled_reconnect_task);
cancel_task(cp->scheduled_reconnect_task);
+ cp->scheduled_reconnect_task = NULL;
}
log_notice("%s Destroying", print_obj(cp));
dn_free(cp);
@@ -199,6 +199,7 @@ conn_pool_notify_conn_errored(conn_pool_t *cp)
// check if reconnect task is active
// if so , never mind
if (cp->scheduled_reconnect_task) {
+ log_notice("%s already have a reconnect task %p", print_obj(cp), cp->scheduled_reconnect_task);
return;
}
// else increase error count, and schedule a task after the backoff wait
