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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to