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 2022/07/17 18:33:09 UTC

[GitHub] [apisix] haynesxiang opened a new pull request, #7479: docs:fix unhealthy.failures attribute description of api-breaker plugin

haynesxiang opened a new pull request, #7479:
URL: https://github.com/apache/apisix/pull/7479

   ### Description
   
   <!-- Please include a summary of the change and which issue is fixed. -->
   <!-- Please also include relevant motivation and context. -->
   
   Fixes # (issue)
   
   ### Checklist
   
   - [ ] I have explained the need for this PR and the problem it solves
   - [ ] I have explained the changes or the new features added to this PR
   - [ ] I have added tests corresponding to this change
   - [ ] I have updated the documentation to reflect this change
   - [ ] I have verified that this change is backward compatible (If not, please discuss on the [APISIX mailing list](https://github.com/apache/apisix/tree/master#community) first)
   
   <!--
   
   Note
   
   1. Mark the PR as draft until it's ready to be reviewed.
   2. Always add/update tests for any changes unless you have a good reason.
   3. Always update the documentation to reflect the changes made in the PR.
   4. Make a new commit to resolve conversations instead of `push -f`.
   5. To resolve merge conflicts, merge master instead of rebasing.
   6. Use "request review" to notify the reviewer after making changes.
   7. Only a reviewer can mark a conversation as resolved.
   
   -->
   


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

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] tokers commented on a diff in pull request #7479: docs:fix unhealthy.failures attribute description of api-breaker plugin

Posted by GitBox <gi...@apache.org>.
tokers commented on code in PR #7479:
URL: https://github.com/apache/apisix/pull/7479#discussion_r922922887


##########
docs/en/latest/plugins/api-breaker.md:
##########
@@ -46,7 +46,7 @@ In an unhealthy state, if the Upstream service responds with a status code from
 | break_response_headers  | array[object]  | False    |         | [{"key":"header_name","value":"can contain Nginx $var"}] | Headers of the response message to return when Upstream is unhealthy. Can only be configured when the `break_response_body` attribute is configured. The values can contain APISIX variables. For example, we can use `{"key":"X-Client-Addr","value":"$remote_addr:$remote_port"}`. |
 | max_breaker_sec         | integer        | False    | 300     | >=3             | Maximum time in seconds for circuit breaking.                                                                                                                                                                                                |
 | unhealthy.http_statuses | array[integer] | False    | [500]   | [500, ..., 599] | Status codes of Upstream to be considered unhealthy.                                                                                                                                                                                         |
-| unhealthy.failures      | integer        | False    | 3       | >=1             | Number of consecutive failures for the Upstream service to be considered unhealthy.                                                                                                                                                          |
+| unhealthy.failures      | integer        | False    | 3       | >=1             | Number of failures for the Upstream service to be considered unhealthy,which only takes effect if the number of consecutive success requests between failed requests does not reach `healthy.successes`.                                                                                                                                                          |

Review Comment:
   The description is confusing. Maybe we don't need to highlight it.
   
   @tzssangglass What's your opinion?



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

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] SylviaBABY commented on a diff in pull request #7479: docs:fix unhealthy.failures attribute description of api-breaker plugin

Posted by GitBox <gi...@apache.org>.
SylviaBABY commented on code in PR #7479:
URL: https://github.com/apache/apisix/pull/7479#discussion_r923131517


##########
docs/zh/latest/plugins/api-breaker.md:
##########
@@ -85,7 +85,7 @@ curl "http://127.0.0.1:9080/apisix/admin/routes/1" -H 'X-API-KEY: edd1c9f034335f
 
 ## 测试插件
 
-使用上游的配置,如果你的上流服务返回 500,连续 3 次。客户端将会收到 502(break_response_code)应答。
+使用上游的配置,在一定时间内如果你的上流服务返回 500 达到3 次。客户端将会收到 502(break_response_code)应答。

Review Comment:
   you need to add a space between number and letter, otherwise `Doc Lint / Chinese Copywriting (pull_request) ` will not pass
   <img width="876" alt="image" src="https://user-images.githubusercontent.com/39793568/179481501-c2262e09-3f2e-4442-bd1b-ea4c62ea32f9.png">
   



##########
docs/zh/latest/plugins/api-breaker.md:
##########
@@ -85,7 +85,7 @@ curl "http://127.0.0.1:9080/apisix/admin/routes/1" -H 'X-API-KEY: edd1c9f034335f
 
 ## 测试插件
 
-使用上游的配置,如果你的上流服务返回 500,连续 3 次。客户端将会收到 502(break_response_code)应答。
+使用上游的配置,在一定时间内如果你的上流服务返回 500 达到3 次。客户端将会收到 502(break_response_code)应答。

Review Comment:
   ```suggestion
   使用上游的配置,在一定时间内如果你的上流服务返回 500 达到 3 次。客户端将会收到 502(break_response_code)应答。
   ```



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

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] haynesxiang commented on a diff in pull request #7479: docs:fix unhealthy.failures attribute description of api-breaker plugin

Posted by GitBox <gi...@apache.org>.
haynesxiang commented on code in PR #7479:
URL: https://github.com/apache/apisix/pull/7479#discussion_r923359366


##########
docs/zh/latest/plugins/api-breaker.md:
##########
@@ -48,14 +48,14 @@ title: api-breaker
 | break_response_headers  | array[object]  | 可选   | 无         | [{"key":"header_name","value":"can contain Nginx $var"}] | 不健康返回报文头,这里可以设置多个。该字段仅在 `break_response_body` 被配置时生效。这个值能够以 `$var` 的格式包含 APISIX 变量,比如 `{"key":"X-Client-Addr","value":"$remote_addr:$remote_port"}`。 |
 | max_breaker_sec         | integer        | 可选   | 300        | >=3             | 最大熔断持续时间                 |
 | unhealthy.http_statuses | array[integer] | 可选   | {500}      | [500, ..., 599] | 不健康时候的状态码               |
-| unhealthy.failures      | integer        | 可选   | 3          | >=1             | 触发不健康状态的连续错误请求次数 |
+| unhealthy.failures      | integer        | 可选   | 3          | >=1             | 在一定时间内触发不健康状态的异常请求次数|

Review Comment:
   ok, thanks



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

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] SylviaBABY commented on a diff in pull request #7479: docs:fix unhealthy.failures attribute description of api-breaker plugin

Posted by GitBox <gi...@apache.org>.
SylviaBABY commented on code in PR #7479:
URL: https://github.com/apache/apisix/pull/7479#discussion_r922927091


##########
docs/zh/latest/plugins/api-breaker.md:
##########
@@ -48,14 +48,14 @@ title: api-breaker
 | break_response_headers  | array[object]  | 可选   | 无         | [{"key":"header_name","value":"can contain Nginx $var"}] | 不健康返回报文头,这里可以设置多个。该字段仅在 `break_response_body` 被配置时生效。这个值能够以 `$var` 的格式包含 APISIX 变量,比如 `{"key":"X-Client-Addr","value":"$remote_addr:$remote_port"}`。 |
 | max_breaker_sec         | integer        | 可选   | 300        | >=3             | 最大熔断持续时间                 |
 | unhealthy.http_statuses | array[integer] | 可选   | {500}      | [500, ..., 599] | 不健康时候的状态码               |
-| unhealthy.failures      | integer        | 可选   | 3          | >=1             | 触发不健康状态的连续错误请求次数 |
+| unhealthy.failures      | integer        | 可选   | 3          | >=1             | 触发不健康状态的异常请求次数,并且异常请求间连续正常请求未达到触发健康状态的次数 |
 | healthy.http_statuses   | array[integer] | 可选   | {200}      | [200, ..., 499] | 健康时候的状态码                 |
 | healthy.successes       | integer        | 可选   | 3          | >=1             | 触发健康状态的连续正常请求次数   |
 
 ## 启用方式
 
 这是一个示例,在指定的路由上启用 `api-breaker` 插件。
-应答 500 或 503 连续 3 次,触发熔断。应答 200 连续 1 次,恢复健康。
+应答 500 或 503 3 次且异常请求间应答 200 未达到1次,触发熔断。应答 200 连续 1 次,恢复健康。

Review Comment:
   ```suggestion
   应答 500 或 503 的次数达到 3 且异常请求间应答 200 未达到 1 次,触发熔断。应答 200 连续 1 次,恢复健康。
   ```



##########
docs/zh/latest/plugins/api-breaker.md:
##########
@@ -85,7 +85,7 @@ curl "http://127.0.0.1:9080/apisix/admin/routes/1" -H 'X-API-KEY: edd1c9f034335f
 
 ## 测试插件
 
-使用上游的配置,如果你的上流服务返回 500,连续 3 次。客户端将会收到 502(break_response_code)应答。
+使用上游的配置,如果你的上流服务返回 500 3 次且异常请求间返回 200 未达到1次。客户端将会收到 502(break_response_code)应答。

Review Comment:
   ```suggestion
   使用上游的配置,如果你的上流服务返回 500 次数达到 3 且异常请求间返回 200 未达到 1 次。客户端将会收到 502(break_response_code)应答。
   ```



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

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] SylviaBABY commented on a diff in pull request #7479: docs:fix unhealthy.failures attribute description of api-breaker plugin

Posted by GitBox <gi...@apache.org>.
SylviaBABY commented on code in PR #7479:
URL: https://github.com/apache/apisix/pull/7479#discussion_r923352018


##########
docs/zh/latest/plugins/api-breaker.md:
##########
@@ -48,14 +48,14 @@ title: api-breaker
 | break_response_headers  | array[object]  | 可选   | 无         | [{"key":"header_name","value":"can contain Nginx $var"}] | 不健康返回报文头,这里可以设置多个。该字段仅在 `break_response_body` 被配置时生效。这个值能够以 `$var` 的格式包含 APISIX 变量,比如 `{"key":"X-Client-Addr","value":"$remote_addr:$remote_port"}`。 |
 | max_breaker_sec         | integer        | 可选   | 300        | >=3             | 最大熔断持续时间                 |
 | unhealthy.http_statuses | array[integer] | 可选   | {500}      | [500, ..., 599] | 不健康时候的状态码               |
-| unhealthy.failures      | integer        | 可选   | 3          | >=1             | 触发不健康状态的连续错误请求次数 |
+| unhealthy.failures      | integer        | 可选   | 3          | >=1             | 在一定时间内触发不健康状态的异常请求次数|

Review Comment:
   you can click details for more information
   <img width="869" alt="image" src="https://user-images.githubusercontent.com/39793568/179518046-8f78a1b9-f385-4c8e-8304-13d2a8c1af44.png">
   
   <img width="931" alt="image" src="https://user-images.githubusercontent.com/39793568/179517813-edf44729-0fd2-4680-93b3-05bbe5755a9d.png">
   



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

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] tzssangglass commented on a diff in pull request #7479: docs:fix unhealthy.failures attribute description of api-breaker plugin

Posted by GitBox <gi...@apache.org>.
tzssangglass commented on code in PR #7479:
URL: https://github.com/apache/apisix/pull/7479#discussion_r922926386


##########
docs/en/latest/plugins/api-breaker.md:
##########
@@ -46,7 +46,7 @@ In an unhealthy state, if the Upstream service responds with a status code from
 | break_response_headers  | array[object]  | False    |         | [{"key":"header_name","value":"can contain Nginx $var"}] | Headers of the response message to return when Upstream is unhealthy. Can only be configured when the `break_response_body` attribute is configured. The values can contain APISIX variables. For example, we can use `{"key":"X-Client-Addr","value":"$remote_addr:$remote_port"}`. |
 | max_breaker_sec         | integer        | False    | 300     | >=3             | Maximum time in seconds for circuit breaking.                                                                                                                                                                                                |
 | unhealthy.http_statuses | array[integer] | False    | [500]   | [500, ..., 599] | Status codes of Upstream to be considered unhealthy.                                                                                                                                                                                         |
-| unhealthy.failures      | integer        | False    | 3       | >=1             | Number of consecutive failures for the Upstream service to be considered unhealthy.                                                                                                                                                          |
+| unhealthy.failures      | integer        | False    | 3       | >=1             | Number of failures for the Upstream service to be considered unhealthy,which only takes effect if the number of consecutive success requests between failed requests does not reach `healthy.successes`.                                                                                                                                                          |

Review Comment:
   what about:  If the upstream service returns `unhealthy.http_statuses` `unhealthy.failures` times in a row within a certain period of time, it is considered unhealthy.



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

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] SylviaBABY commented on a diff in pull request #7479: docs:fix unhealthy.failures attribute description of api-breaker plugin

Posted by GitBox <gi...@apache.org>.
SylviaBABY commented on code in PR #7479:
URL: https://github.com/apache/apisix/pull/7479#discussion_r923351286


##########
docs/zh/latest/plugins/api-breaker.md:
##########
@@ -48,14 +48,14 @@ title: api-breaker
 | break_response_headers  | array[object]  | 可选   | 无         | [{"key":"header_name","value":"can contain Nginx $var"}] | 不健康返回报文头,这里可以设置多个。该字段仅在 `break_response_body` 被配置时生效。这个值能够以 `$var` 的格式包含 APISIX 变量,比如 `{"key":"X-Client-Addr","value":"$remote_addr:$remote_port"}`。 |
 | max_breaker_sec         | integer        | 可选   | 300        | >=3             | 最大熔断持续时间                 |
 | unhealthy.http_statuses | array[integer] | 可选   | {500}      | [500, ..., 599] | 不健康时候的状态码               |
-| unhealthy.failures      | integer        | 可选   | 3          | >=1             | 触发不健康状态的连续错误请求次数 |
+| unhealthy.failures      | integer        | 可选   | 3          | >=1             | 在一定时间内触发不健康状态的异常请求次数|

Review Comment:
   ```suggestion
   | unhealthy.failures      | integer        | 可选   | 3          | >=1             | 在一定时间内触发不健康状态的异常请求次数 |
   ```



##########
docs/zh/latest/plugins/api-breaker.md:
##########
@@ -48,14 +48,14 @@ title: api-breaker
 | break_response_headers  | array[object]  | 可选   | 无         | [{"key":"header_name","value":"can contain Nginx $var"}] | 不健康返回报文头,这里可以设置多个。该字段仅在 `break_response_body` 被配置时生效。这个值能够以 `$var` 的格式包含 APISIX 变量,比如 `{"key":"X-Client-Addr","value":"$remote_addr:$remote_port"}`。 |
 | max_breaker_sec         | integer        | 可选   | 300        | >=3             | 最大熔断持续时间                 |
 | unhealthy.http_statuses | array[integer] | 可选   | {500}      | [500, ..., 599] | 不健康时候的状态码               |
-| unhealthy.failures      | integer        | 可选   | 3          | >=1             | 触发不健康状态的连续错误请求次数 |
+| unhealthy.failures      | integer        | 可选   | 3          | >=1             | 在一定时间内触发不健康状态的异常请求次数|

Review Comment:
   <img width="931" alt="image" src="https://user-images.githubusercontent.com/39793568/179517813-edf44729-0fd2-4680-93b3-05bbe5755a9d.png">
   



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

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] spacewander merged pull request #7479: docs:fix unhealthy.failures attribute description of api-breaker plugin

Posted by GitBox <gi...@apache.org>.
spacewander merged PR #7479:
URL: https://github.com/apache/apisix/pull/7479


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

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] tzssangglass commented on a diff in pull request #7479: docs:fix unhealthy.failures attribute description of api-breaker plugin

Posted by GitBox <gi...@apache.org>.
tzssangglass commented on code in PR #7479:
URL: https://github.com/apache/apisix/pull/7479#discussion_r922924525


##########
docs/en/latest/plugins/api-breaker.md:
##########
@@ -46,7 +46,7 @@ In an unhealthy state, if the Upstream service responds with a status code from
 | break_response_headers  | array[object]  | False    |         | [{"key":"header_name","value":"can contain Nginx $var"}] | Headers of the response message to return when Upstream is unhealthy. Can only be configured when the `break_response_body` attribute is configured. The values can contain APISIX variables. For example, we can use `{"key":"X-Client-Addr","value":"$remote_addr:$remote_port"}`. |
 | max_breaker_sec         | integer        | False    | 300     | >=3             | Maximum time in seconds for circuit breaking.                                                                                                                                                                                                |
 | unhealthy.http_statuses | array[integer] | False    | [500]   | [500, ..., 599] | Status codes of Upstream to be considered unhealthy.                                                                                                                                                                                         |
-| unhealthy.failures      | integer        | False    | 3       | >=1             | Number of consecutive failures for the Upstream service to be considered unhealthy.                                                                                                                                                          |
+| unhealthy.failures      | integer        | False    | 3       | >=1             | Number of failures for the Upstream service to be considered unhealthy,which only takes effect if the number of consecutive success requests between failed requests does not reach `healthy.successes`.                                                                                                                                                          |

Review Comment:
   It is a bit confusing



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

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] haynesxiang commented on a diff in pull request #7479: docs:fix unhealthy.failures attribute description of api-breaker plugin

Posted by GitBox <gi...@apache.org>.
haynesxiang commented on code in PR #7479:
URL: https://github.com/apache/apisix/pull/7479#discussion_r922945634


##########
docs/en/latest/plugins/api-breaker.md:
##########
@@ -46,7 +46,7 @@ In an unhealthy state, if the Upstream service responds with a status code from
 | break_response_headers  | array[object]  | False    |         | [{"key":"header_name","value":"can contain Nginx $var"}] | Headers of the response message to return when Upstream is unhealthy. Can only be configured when the `break_response_body` attribute is configured. The values can contain APISIX variables. For example, we can use `{"key":"X-Client-Addr","value":"$remote_addr:$remote_port"}`. |
 | max_breaker_sec         | integer        | False    | 300     | >=3             | Maximum time in seconds for circuit breaking.                                                                                                                                                                                                |
 | unhealthy.http_statuses | array[integer] | False    | [500]   | [500, ..., 599] | Status codes of Upstream to be considered unhealthy.                                                                                                                                                                                         |
-| unhealthy.failures      | integer        | False    | 3       | >=1             | Number of consecutive failures for the Upstream service to be considered unhealthy.                                                                                                                                                          |
+| unhealthy.failures      | integer        | False    | 3       | >=1             | Number of failures for the Upstream service to be considered unhealthy,which only takes effect if the number of consecutive success requests between failed requests does not reach `healthy.successes`.                                                                                                                                                          |

Review Comment:
   if healthy.successes is configured with 2 and unhealthy.failures is configured wituh 3, there are scenarios:
   1.request 1 return failed, request 2 return failed,  request 3 return success, request 4 return failed,  it is considered unhealthy.
   2.request 1 return failed, request 2 return failed,  request 3 return success, request 4 return success, request 4 return failed,  it is considered as healthy status.
   
   So, how about describe it:  If the upstream service returns unhealthy.http_statuses unhealthy.failures times and returns healthy.http_statuses times does not reach healthy.successes within a certain period of time, it is considered unhealthy.
   
   Or we just describe it as "Number of failures for the Upstream service to be considered unhealthy within a certain period of time"



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

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org