]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
notes on how it works, and what to fix in the future
authorAlan T. DeKok <aland@freeradius.org>
Fri, 27 Sep 2019 13:59:59 +0000 (09:59 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 27 Sep 2019 13:59:59 +0000 (09:59 -0400)
src/lib/unlang/parallel.c

index eacd368b22490a7c035c0486116fdd8e89bb48f2..be558017bce5f6c11cbb77bce2d3f9f1623120d6 100644 (file)
@@ -44,6 +44,10 @@ static unlang_action_t unlang_parallel_child_done(REQUEST *request, UNUSED rlm_r
         *      Otherwise we're a detached child, and we don't tell
         *      the parent anything.  Because we have that kind of
         *      relationship.
+        *
+        *      Note that we call unlang_interpret_resumable() here
+        *      because unlang_parallel_run() calls
+        *      unlang_interpret_run(), and NOT child->async->process.
         */
        if (request->parent) {
                child->state = CHILD_EXITED;
@@ -174,6 +178,14 @@ static rlm_rcode_t unlang_parallel_run(REQUEST *request, unlang_parallel_t *stat
                case CHILD_RUNNABLE:
                runnable:
                        RDEBUG2("parallel - running entry %d/%d", i + 1, state->num_children);
+
+                       /*
+                        *      Note that we do NOT call child->async-process()
+                        *
+                        *      Doing that will end up calling
+                        *      unlang_parallel_child_done(), and all
+                        *      kinds of things happen..
+                        */
                        result = unlang_interpret_run(state->children[i].child);
                        if (result == RLM_MODULE_YIELD) {
                                state->children[i].state = CHILD_YIELDED;