From: Nick Porter Date: Thu, 9 Oct 2025 14:17:48 +0000 (+0100) Subject: Handle cancelling SQL requests that are already reapable X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=601a41f2609fd9e647bdcb828b2ee71058a75fe2;p=thirdparty%2Ffreeradius-server.git Handle cancelling SQL requests that are already reapable These are really complete, and don't need to go round the query cancellation path. --- diff --git a/src/modules/rlm_sql/sql.c b/src/modules/rlm_sql/sql.c index 6c340b94753..9e893333697 100644 --- a/src/modules/rlm_sql/sql.c +++ b/src/modules/rlm_sql/sql.c @@ -212,6 +212,15 @@ static void sql_trunk_query_cancel(UNUSED request_t *request, UNUSED fr_signal_t if (!query_ctx->treq) return; + /* + * A reapable trunk request has already completed. + */ + if (unlikely(query_ctx->treq->state == TRUNK_REQUEST_STATE_REAPABLE)) { + trunk_request_signal_complete(query_ctx->treq); + query_ctx->treq = NULL; + return; + } + /* * The query_ctx needs to be parented by the treq so that it still exists * when the cancel_mux callback is run.