]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
rlm_kafka: continue the wake drain loop after a cancelled pctx
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Fri, 24 Apr 2026 16:15:14 +0000 (12:15 -0400)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Sun, 26 Apr 2026 22:12:03 +0000 (18:12 -0400)
_kafka_wake loops over the atomic ring draining pctx the bg cb pushed,
checks pctx->request, and if the worker-side cancel handler has already
NULLed it, frees the pctx without marking a request runnable.  It was
using `return` on that branch (copy-pasted from the one-shot
kafka_delivery_notification()), which exits the whole drain loop as
soon as the first cancelled entry comes up, leaving any subsequent
live pctx stranded in the ring - their requests never get resumed and
end up cancelled by max_request_time instead.

Switch to `continue` so the rest of the ring still drains.

src/modules/rlm_kafka/rlm_kafka.c

index 1a8acb6249d4c89aa0f729fd3d4f14eb52460d40..e9d7efe5c76c06865d6a1ee41b89ea04bee971f5 100644 (file)
@@ -324,7 +324,7 @@ static void _kafka_wake(UNUSED fr_event_list_t *el, void *uctx)
 
                if (!request) {
                        free(pctx);
-                       return;
+                       continue;
                }
                unlang_interpret_mark_runnable(request);
        }