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/03 14:07:20 UTC

[GitHub] [apisix] OnlyPiglet opened a new issue #2613: request help: If the fusing interval of apisix depends on the setttings of upstream.checks.active.healthy.interval

OnlyPiglet opened a new issue #2613:
URL: https://github.com/apache/apisix/issues/2613


   ### Issue description
   
   If the fusing interval  of apisix depends on the setttings of  upstream.checks.active.healthy.interval , the checker won't report after a failed 502 request? is this right?
   
   Thanks for helping.


----------------------------------------------------------------
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



[GitHub] [apisix] spacewander commented on issue #2613: request help: If the fusing interval of apisix depends on the setttings of upstream.checks.active.healthy.interval

Posted by GitBox <gi...@apache.org>.
spacewander commented on issue #2613:
URL: https://github.com/apache/apisix/issues/2613#issuecomment-721582722


   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.


----------------------------------------------------------------
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



[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

Posted by GitBox <gi...@apache.org>.
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



[GitHub] [apisix] spacewander closed issue #2613: request help: If the fusing interval of apisix depends on the setttings of upstream.checks.active.healthy.interval

Posted by GitBox <gi...@apache.org>.
spacewander closed issue #2613:
URL: https://github.com/apache/apisix/issues/2613


   


----------------------------------------------------------------
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



[GitHub] [apisix] idbeta commented on issue #2613: request help: If the fusing interval of apisix depends on the setttings of upstream.checks.active.healthy.interval

Posted by GitBox <gi...@apache.org>.
idbeta commented on issue #2613:
URL: https://github.com/apache/apisix/issues/2613#issuecomment-721518450


   Could you give more detail of the configuration about your doubt?


----------------------------------------------------------------
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



[GitHub] [apisix] OnlyPiglet edited a comment on issue #2613: request help: If the fusing interval of apisix depends on the setttings of upstream.checks.active.healthy.interval

Posted by GitBox <gi...@apache.org>.
OnlyPiglet edited a comment 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, 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
   


----------------------------------------------------------------
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



[GitHub] [apisix] spacewander commented on issue #2613: request help: If the fusing interval of apisix depends on the setttings of upstream.checks.active.healthy.interval

Posted by GitBox <gi...@apache.org>.
spacewander commented on issue #2613:
URL: https://github.com/apache/apisix/issues/2613#issuecomment-721465381


   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.


----------------------------------------------------------------
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



[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

Posted by GitBox <gi...@apache.org>.
OnlyPiglet commented on issue #2613:
URL: https://github.com/apache/apisix/issues/2613#issuecomment-721581053


   @spacewander  thanks a lot I see,I use active checker,so it didn't work. 


----------------------------------------------------------------
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



[GitHub] [apisix] spacewander edited a comment on issue #2613: request help: If the fusing interval of apisix depends on the setttings of upstream.checks.active.healthy.interval

Posted by GitBox <gi...@apache.org>.
spacewander edited a comment on issue #2613:
URL: https://github.com/apache/apisix/issues/2613#issuecomment-721543426


   > 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


----------------------------------------------------------------
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



[GitHub] [apisix] spacewander commented on issue #2613: request help: If the fusing interval of apisix depends on the setttings of upstream.checks.active.healthy.interval

Posted by GitBox <gi...@apache.org>.
spacewander commented on issue #2613:
URL: https://github.com/apache/apisix/issues/2613#issuecomment-721543426


   > so the bad request won't be report
   
   The bad request will be reported in elsewhere:
   https://github.com/apache/apisix/blob/61cd91440bb8826d616e7a056428fe42ea64ebd0/apisix/init.lua#L649


----------------------------------------------------------------
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



[GitHub] [apisix] OnlyPiglet edited a comment on issue #2613: request help: If the fusing interval of apisix depends on the setttings of upstream.checks.active.healthy.interval

Posted by GitBox <gi...@apache.org>.
OnlyPiglet edited a comment 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, 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?
   


----------------------------------------------------------------
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



[GitHub] [apisix] spacewander commented on issue #2613: request help: If the fusing interval of apisix depends on the setttings of upstream.checks.active.healthy.interval

Posted by GitBox <gi...@apache.org>.
spacewander commented on issue #2613:
URL: https://github.com/apache/apisix/issues/2613#issuecomment-729464561


   Consider solved.


----------------------------------------------------------------
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