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/08/15 01:36:03 UTC

[GitHub] [apisix] SylviaBABY commented on a diff in pull request #7666: docs(plugin): refactor api-breaker.md

SylviaBABY commented on code in PR #7666:
URL: https://github.com/apache/apisix/pull/7666#discussion_r945375419


##########
docs/zh/latest/plugins/api-breaker.md:
##########
@@ -23,42 +28,40 @@ title: api-breaker
 
 ## 描述
 
-该插件实现 API 熔断功能,帮助我们保护上游业务服务。
+`api-breaker` 插件实现了 API 熔断功能,从而帮助我们保护上游业务服务。
 
-> 关于熔断超时逻辑
+:::note 注意
 
-由代码逻辑自动按**触发不健康状态**的次数递增运算:
+关于熔断超时逻辑,由代码逻辑自动按**触发不健康状态**的次数递增运算:
 
-每当上游服务返回 `unhealthy.http_statuses` 配置中的状态码(比如:500),达到 `unhealthy.failures` 次时 (比如:3 次),认为上游服务处于不健康状态。
+每当上游服务返回 `unhealthy.http_statuses` 配置中的状态码(比如:`500`),并达到 `unhealthy.failures` 次时,则认为上游服务处于不健康状态。

Review Comment:
   ```suggestion
   当上游服务返回 `unhealthy.http_statuses` 配置中的状态码(默认为 `500`),并达到 `unhealthy.failures` 预设次数时(默认为 3 次),则认为上游服务处于不健康状态。
   ```



##########
docs/zh/latest/plugins/api-breaker.md:
##########
@@ -23,42 +28,40 @@ title: api-breaker
 
 ## 描述
 
-该插件实现 API 熔断功能,帮助我们保护上游业务服务。
+`api-breaker` 插件实现了 API 熔断功能,从而帮助我们保护上游业务服务。
 
-> 关于熔断超时逻辑
+:::note 注意
 
-由代码逻辑自动按**触发不健康状态**的次数递增运算:
+关于熔断超时逻辑,由代码逻辑自动按**触发不健康状态**的次数递增运算:
 
-每当上游服务返回 `unhealthy.http_statuses` 配置中的状态码(比如:500),达到 `unhealthy.failures` 次时 (比如:3 次),认为上游服务处于不健康状态。
+每当上游服务返回 `unhealthy.http_statuses` 配置中的状态码(比如:`500`),并达到 `unhealthy.failures` 次时,则认为上游服务处于不健康状态。
 
-第一次触发不健康状态,**熔断 2 秒**。
+第一次触发不健康状态,熔断 2 秒,然后重新开始转发请求到上游服务,如果继续返回 `unhealthy.http_statuses` 状态码,记数再次达到 `unhealthy.failures` 次时,熔断 4 秒。依次类推,2,4,8,16,最大到 `max_breaker_sec`。

Review Comment:
   ```suggestion
   第一次触发不健康状态时,熔断 2 秒。超过熔断时间后,将重新开始转发请求到上游服务,如果继续返回 `unhealthy.http_statuses` 状态码,记数再次达到 `unhealthy.failures` 预设次数时,熔断 4 秒。依次类推(2,4,8,16,……),直到达到预设的 `max_breaker_sec`值。
   ```



##########
docs/zh/latest/plugins/api-breaker.md:
##########
@@ -23,42 +28,40 @@ title: api-breaker
 
 ## 描述
 
-该插件实现 API 熔断功能,帮助我们保护上游业务服务。
+`api-breaker` 插件实现了 API 熔断功能,从而帮助我们保护上游业务服务。
 
-> 关于熔断超时逻辑
+:::note 注意
 
-由代码逻辑自动按**触发不健康状态**的次数递增运算:
+关于熔断超时逻辑,由代码逻辑自动按**触发不健康状态**的次数递增运算:
 
-每当上游服务返回 `unhealthy.http_statuses` 配置中的状态码(比如:500),达到 `unhealthy.failures` 次时 (比如:3 次),认为上游服务处于不健康状态。
+每当上游服务返回 `unhealthy.http_statuses` 配置中的状态码(比如:`500`),并达到 `unhealthy.failures` 次时,则认为上游服务处于不健康状态。
 
-第一次触发不健康状态,**熔断 2 秒**。
+第一次触发不健康状态,熔断 2 秒,然后重新开始转发请求到上游服务,如果继续返回 `unhealthy.http_statuses` 状态码,记数再次达到 `unhealthy.failures` 次时,熔断 4 秒。依次类推,2,4,8,16,最大到 `max_breaker_sec`。
 
-然后,2 秒过后重新开始转发请求到上游服务,如果继续返回 `unhealthy.http_statuses` 状态码,记数再次达到 `unhealthy.failures` 次时,**熔断 4 秒**(倍数方式)。
+当上游服务处于不健康状态时,如果转发请求到上游服务并返回 `healthy.http_statuses` 配置中的状态码(比如:`200`),并达到 `healthy.successes` 次时,则认为上游服务恢复至健康状态。

Review Comment:
   ```suggestion
   当上游服务处于不健康状态时,如果转发请求到上游服务并返回 `healthy.http_statuses` 配置中的状态码(默认为 `200`),并达到 `healthy.successes` 次时,则认为上游服务恢复至健康状态。
   ```



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