CircuitBreaker will stuck in HALF_OPEN when the last request throw ignored exception
See original GitHub issueWhen the last request during HALF_OPEN state throws exception which set ignored, the CircuitBreaker will stuck in HALF permanently. (found in 0.15.0 version)
see code in : io/github/resilience4j/circuitbreaker/internal/CircuitBreakerStateMachine.java
private void handleThrowable(long durationInNanos, Predicate<Throwable> recordFailurePredicate, Throwable throwable) {
if (recordFailurePredicate.test(throwable)) {
LOG.debug("CircuitBreaker '{}' recorded a failure:", name, throwable);
publishCircuitErrorEvent(name, durationInNanos, throwable);
stateReference.get().onError(throwable);
} else {
publishCircuitIgnoredErrorEvent(name, durationInNanos, throwable);
}
}
If the exception be ignored, the circuit breaker neither invoke the onError() method or execute releasePermission(). After that, the buffer is full and state in HALF_OPEN, means it won’t accept new requests, also won’t change to OPEN or CLOSE state. Just stuck in HALF_OPEN (See CircuitBreakerTransformer.java in https://github.com/resilience4j/resilience4j/pull/542 which resolve this bug in ratpack, but didn’t resolve this bug in core logic.)
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Resilience4j circuit breaker does not switch back to closed ...
What I mean by that is if more than 5 consecutive orders cannot be placed because of a missing item, the circuit does...
Read more >Failover and Circuit Breaker with Resilience4j | by Rob Golder
We see here that if an HttpClientErrorException is thrown on the API call then this will be re-thrown, enabling the correct overloaded fallback...
Read more >How to Prevent Certain Exceptions from Tripping a ...
The Resilience4j circuit breaker by default considers any exception thrown inside of the Supplier as a failure. If over 50% of the calls...
Read more >Implementing a Circuit Breaker with Resilience4j - Reflectoring
The circuit breaker throws a CallNotPermittedException when it is rejecting calls in the open state. We can control the amount of information in ......
Read more >When you use the Polly circuit-breaker, make sure you share ...
When an exception occurs in the CallRatesApi() method, the breaker will catch it, but it will re-throw the exception. In my case, I...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Merged. I will release it next week
Yes