From: Alan T. DeKok Date: Wed, 19 Apr 2017 16:47:53 +0000 (-0400) Subject: notes on selection of redundant node after failure / resumption X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=35ba33459facf7cdb1c87d7adbaeaa829dfca293;p=thirdparty%2Ffreeradius-server.git notes on selection of redundant node after failure / resumption --- diff --git a/src/main/unlang_interpret.c b/src/main/unlang_interpret.c index 7dd7a6dee52..5c7a61db53e 100644 --- a/src/main/unlang_interpret.c +++ b/src/main/unlang_interpret.c @@ -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;