question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CircuitBreaker will stuck in HALF_OPEN when the last request throw ignored exception

See original GitHub issue

When 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:closed
  • Created 4 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

3reactions
RobWincommented, Jul 15, 2019

Merged. I will release it next week

0reactions
RobWincommented, Jul 16, 2019

Yes

Read more comments on GitHub >

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

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found