From: Alan T. DeKok Date: Fri, 14 Jul 2023 13:30:12 +0000 (-0400) Subject: assert that the channel has no running requests before ACK close X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bdec27409cda11b9432c583748bfac69241a118b;p=thirdparty%2Ffreeradius-server.git assert that the channel has no running requests before ACK close and cancel all of the related requests when the worker is signalled to exit. --- diff --git a/src/lib/io/worker.c b/src/lib/io/worker.c index bc722fcf1df..7f01872957c 100644 --- a/src/lib/io/worker.c +++ b/src/lib/io/worker.c @@ -334,6 +334,8 @@ static void worker_channel_callback(void *ctx, void const *data, size_t data_siz fr_assert_msg(fr_dlist_num_elements(&worker->channel[i].dlist) == 0, "Network added messages to channel after sending FR_CHANNEL_CLOSE"); + fr_assert(fr_dlist_num_elements(&worker->channel[i].dlist) == 0); + fr_channel_responder_ack_close(ch); fr_assert(ms != NULL); fr_message_set_gc(ms); @@ -1037,6 +1039,8 @@ void fr_worker_destroy(fr_worker_t *worker) } fr_assert(fr_heap_num_elements(worker->runnable) == 0); + /// + /* * Signal the channels that we're closing. * @@ -1054,6 +1058,9 @@ void fr_worker_destroy(fr_worker_t *worker) fr_assert_msg(fr_dlist_num_elements(&worker->channel[i].dlist) == 0, "Pending messages in channel after cancelling request"); + worker_requests_cancel(&worker->channel[i]); + + fr_assert(fr_dlist_num_elements(&worker->channel[i].dlist) == 0); fr_channel_responder_ack_close(worker->channel[i].ch); }