From: Alan T. DeKok Date: Wed, 18 May 2022 00:15:19 +0000 (-0400) Subject: Revert "put yielded increment / decrement into the callbacks" X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e4027ce33bfb737f787ca0374d63f755a7edda21;p=thirdparty%2Ffreeradius-server.git Revert "put yielded increment / decrement into the callbacks" This reverts commit a3aee1615ab0986cebe596c536e840e667de2943. intp->func.resume() is called when a request _starts_ running for the first time, too. Which means that we can't decrement the "yielded" count, because it's already at zero --- diff --git a/src/lib/unlang/interpret_synchronous.c b/src/lib/unlang/interpret_synchronous.c index 15347c9e33b..60127080392 100644 --- a/src/lib/unlang/interpret_synchronous.c +++ b/src/lib/unlang/interpret_synchronous.c @@ -118,25 +118,17 @@ static void _request_runnable(request_t *request, void *uctx) /** Interpreter yielded request * */ -static void _request_yield(request_t *request, void *uctx) +static void _request_yield(request_t *request, UNUSED void *uctx) { - unlang_interpret_synchronous_t *intps = uctx; - RDEBUG3("synchronous request yielded"); - - intps->yielded++; } /** Interpreter is starting to work on request again * */ -static void _request_resume(request_t *request, void *uctx) +static void _request_resume(request_t *request, UNUSED void *uctx) { - unlang_interpret_synchronous_t *intps = uctx; - RDEBUG3("synchronous request resumed"); - - intps->yielded--; } static bool _request_scheduled(request_t const *request, UNUSED void *uctx) @@ -261,6 +253,8 @@ rlm_rcode_t unlang_interpret_synchronous(fr_event_list_t *el, request_t *request continue; } + if (unlang_interpret_is_resumable(sub_request)) intps->yielded--; + /* * Continue interpretation until there's nothing * in the backlog. If this request YIELDs, then @@ -271,6 +265,8 @@ rlm_rcode_t unlang_interpret_synchronous(fr_event_list_t *el, request_t *request RDEBUG4("<<< interpreter (iteration %i) - %s", iterations, fr_table_str_by_value(rcode_table, sub_rcode, "")); + if (unlang_interpret_is_resumable(sub_request)) intps->yielded++; + if (sub_request == request) { rcode = sub_rcode; /*