request help: If the fusing interval of apisix depends on the setttings of upstream.checks.active.healthy.interval
Issue description
If the fusing interval of apisix depends on the setttings of upstream.checks.active.healthy.interval after I set the retries 0 forcelly , the checker won't report after a failed 502 request? is this right?
Thanks for helping.
I am confused. The retries field in the upstream is not part of the checks. It only affects the proxy request, doesn't impact the health check.
Could you give more detail of the configuration about your doubt?
@idbeta @spacewander this is some part of the function pick_server in the balancer.lua
1 ctx.balancer_try_count = (ctx.balancer_try_count or 0) + 1
2 if checker and ctx.balancer_try_count > 1 then
3 local state, code = get_last_failure()
4 local host = up_conf.checks and up_conf.checks.active and up_conf.checks.active.host
5 local port = up_conf.checks and up_conf.checks.active and up_conf.checks.active.port
6 if state == "failed" then
7 if code == 504 then
8 checker:report_timeout(ctx.balancer_ip, port or ctx.balancer_port, host)
9 else
10 checker:report_tcp_failure(ctx.balancer_ip, port or ctx.balancer_port, host)
11 end
12 else
13 checker:report_http_status(ctx.balancer_ip, port or ctx.balancer_port, host, code)
14 end
15 end
16 if ctx.balancer_try_count == 1 then
17 local retries = up_conf.retries
18 if not retries or retries < 0 then
19 retries = #up_conf.nodes - 1
20 end
21 if retries > 0 then
22 set_more_tries(retries)
23 end
24 end
I mean if I set_more_tries as zero forecelly at the line 19, then the request won't enter the branch if checker and ctx.balancer_try_count > 1 then so the bad request won't be report at noce. right? it's just beacuse I changed the balancer.lua
so the bad request won't be report
The bad request will be reported elsewhere: https://github.com/apache/apisix/blob/61cd91440bb8826d616e7a056428fe42ea64ebd0/apisix/init.lua#L649
@spacewander thanks a lot I see,I use active checker,so it didn't work.
If thing doesn't work for you, please provide a minimal reproduce example, including the configuration, how you test it and the possible error log.
Consider solved.