From 045c26e1067599e7e9f2c4e59055681774bcbb02 Mon Sep 17 00:00:00 2001 From: "Alan T. DeKok" Date: Thu, 1 May 2025 07:03:48 -0400 Subject: [PATCH] retry limits return timeout, not fail --- src/lib/unlang/interpret.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/lib/unlang/interpret.c b/src/lib/unlang/interpret.c index 53a854c368..595060f2f5 100644 --- a/src/lib/unlang/interpret.c +++ b/src/lib/unlang/interpret.c @@ -378,8 +378,7 @@ unlang_frame_action_t result_calculate(request_t *request, unlang_stack_frame_t * then allocate the structure and set the timer. */ if (!retry) { - frame->retry = retry = talloc_zero(stack, unlang_retry_t); - if (!frame->retry) goto fail; + MEM(frame->retry = retry = talloc_zero(stack, unlang_retry_t)); retry->request = request; retry->depth = stack->depth; @@ -398,8 +397,9 @@ unlang_frame_action_t result_calculate(request_t *request, unlang_stack_frame_t if (fr_timer_at(retry, unlang_interpret_event_list(request)->tl, &retry->ev, retry->timeout, false, instruction_retry_handler, request) < 0) { - RPEDEBUG("Failed inserting event"); - goto fail; + RPEDEBUG("Failed inserting retry event"); + *result = RLM_MODULE_FAIL; + goto finalize; } } @@ -408,7 +408,7 @@ unlang_frame_action_t result_calculate(request_t *request, unlang_stack_frame_t * We've been told to stop doing retries, * probably from a timeout. */ - if (retry->state != FR_RETRY_CONTINUE) goto fail; + if (retry->state != FR_RETRY_CONTINUE) goto timeout; /* * Clamp it at the maximum count. @@ -419,10 +419,10 @@ unlang_frame_action_t result_calculate(request_t *request, unlang_stack_frame_t if (retry->count >= instruction->actions.retry.mrc) { retry->state = FR_RETRY_MRC; - REDEBUG("Retries hit max_rtx_count (%u) - returning 'fail'", instruction->actions.retry.mrc); + REDEBUG("Retries hit max_rtx_count (%u) - returning 'timeout'", instruction->actions.retry.mrc); - fail: - *result = RLM_MODULE_FAIL; + timeout: + *result = RLM_MODULE_TIMEOUT; goto finalize; } } -- 2.47.2