You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2020/11/04 05:57:39 UTC
[GitHub] [apisix] OnlyPiglet commented on issue #2613: request help: If the fusing interval of apisix depends on the setttings of upstream.checks.active.healthy.interval
OnlyPiglet commented on issue #2613:
URL: https://github.com/apache/apisix/issues/2613#issuecomment-721528122
@idbeta @spacewander
this is some part of the function pick_server in the balancer.lua
```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, the 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?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org