]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
notes on selection of redundant node after failure / resumption
authorAlan T. DeKok <aland@freeradius.org>
Wed, 19 Apr 2017 16:47:53 +0000 (12:47 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 19 Apr 2017 16:49:34 +0000 (12:49 -0400)
src/main/unlang_interpret.c

index 7dd7a6dee5232622559db8815907db78bc4aeabf..5c7a61db53eec46a0ef6a258ee0b7acc73117c31 100644 (file)
@@ -258,6 +258,12 @@ static unlang_action_t unlang_load_balance(REQUEST *request, unlang_stack_t *sta
                frame->redundant.child = frame->redundant.found;
 
        } else {
+               /*
+                *      We are in a resumed frame.  The module we
+                *      chose failed, so we have to go through the
+                *      process again.
+                */
+
                rad_assert(instruction->type != UNLANG_TYPE_LOAD_BALANCE); /* this is never called again */
 
                /*
@@ -267,6 +273,15 @@ static unlang_action_t unlang_load_balance(REQUEST *request, unlang_stack_t *sta
                        return UNLANG_ACTION_CALCULATE_RESULT;
                }
 
+               /*
+                *      @todo - track the one we chose, and if it
+                *      fails, do the load-balancing again, except
+                *      this time skipping the failed module.  AND,
+                *      keep track of multiple failed modules.
+                *      Probably in the unlang_resume_t, via a
+                *      uint64_t and bit mask for simplicity.
+                */
+
                frame->redundant.child = frame->redundant.child->next;
                if (!frame->redundant.child) frame->redundant.child = g->children;