fix(api-breaker): inconsistent circuit breaking due to premature breaker_time increment#12451
Merged
Merged
Conversation
…ker_time increment
membphis
approved these changes
Jul 21, 2025
nic-6443
approved these changes
Jul 21, 2025
nic-chen
approved these changes
Jul 21, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The circuit breaker did not operate as configured. In the following logs, the circuit breaker condition is triggered by 5 occurrences of 500/502/503 responses, and lines 18 and 19 should not have tripped
Reason
When set to ceil breaker_time is prematurely increased causing inconsistency. Consider the flow:
5 requests fail->2 second breaker_time->6th request fail and due to ceil, breaker_time is immediately set to 4 seconds. So if 7th request comes just before 4 seconds, it will be blocked as well.
The behaviour should be 5 requests fail->2 second circuit break->5 more requests fail->4 second circuit break->5 more requests fail->8 second circuit break.... And so on
Reproduction steps
Checklist