zhoujiexiong commented on PR #11415:
URL: https://github.com/apache/apisix/pull/11415#issuecomment-2264944953

   > > this bug only occurs when both `healthy` and `max_breaker_sec` are 
configured together?
   > 
   > No,This bug is easy to reproduce.It can be reproduced with the default 
configuration.But it needs to be explained in conjunction with the api-breaker 
plug-in code. As shown in the following picture: 
![api-breaker](https://private-user-images.githubusercontent.com/35733984/354515522-925b8b8b-f8ec-4dee-a013-76d944063c8b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjI1ODk1ODAsIm5iZiI6MTcyMjU4OTI4MCwicGF0aCI6Ii8zNTczMzk4NC8zNTQ1MTU1MjItOTI1YjhiOGItZjhlYy00ZGVlLWEwMTMtNzZkOTQ0MDYzYzhiLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MDIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODAyVDA5MDEyMFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTg5YTlhYTQ5MmFlYjkzYzM1ZmUzYjgzNDRjNTRiYmM0NWU0MTU1ZWYyMTZiZGQ3N2NjYjU0OGNkMjBmZWEyMWQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.xwEE
 jzdt730_lUsICNWcyrf01HkVxoyXLEknRrlxHh8) In an unhealthy state,The request is 
then retried in 2, 4, 8, 16 ... seconds until the max_breaker_sec.In this 
process, there is often a situation:when the specified unhealthy state has not 
been reached, the breaker is triggered. The reason is that when the specified 
number of unhealthy states is not reached, lasttime + breaker_time will 
occasionally appear to be greater than or equal to ngx.time().This causes a 
breaker to occur. The solution is shown in the following figure: 
![api-breaker2](https://private-user-images.githubusercontent.com/35733984/354520658-894dac93-03d1-490d-a9c2-b38220c4443c.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjI1ODk1ODAsIm5iZiI6MTcyMjU4OTI4MCwicGF0aCI6Ii8zNTczMzk4NC8zNTQ1MjA2NTgtODk0ZGFjOTMtMDNkMS00OTBkLWE5YzItYjM4MjIwYzQ0NDNjLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxT
 
QTUzUFFLNFpBJTJGMjAyNDA4MDIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODAyVDA5MDEyMFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWJkMTg4YTNlNjM2ZjJlZDQ0NGEyMzdkNTZhZDNhNWU2MDg1MzBlYzQyZGEyNWQ5NDc0OTk4ZDU2ODEyZDAyZTkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.oJmjDSzoM_ZGi3dv904jWvW73Pmveoy7p63SiAq5e1o)
   
   Suppose there are 4 requests inbound, 3 failed, breaker triggered, then the 
4th increase the `unhealthy_count` at `log_phase`, the modification of the PR 
would exit the breaking state?


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