-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Circuit breaker in DISABLED state sill moving back to HALF_OPEN/OPEN #2135
Comments
No, this is not expected. Could you please show some logs and code? |
Hi RobWin. Sure, let me try to give some more details. I annotate the method on which I want to put the CircuitBreaker as follows :
Here is the config I put in my application.yml
Here is the code I use to toggle the CircuitBreaker off
And finally some logs that show the transitions of the CircuitBreaker
|
Can you please show my your CircuitBreakerConfig? |
Sure, here it is
|
That's strange. In the disabled state nothing should happen -> https://github.com/resilience4j/resilience4j/blob/master/resilience4j-circuitbreaker/src/main/java/io/github/resilience4j/circuitbreaker/internal/CircuitBreakerStateMachine.java#L825 I don't see any transition from DISABLED to CLOSED. |
Oh, you're right ! I had not realized I did have multiple instances of the circuit breaker. My app is running on Kubernetes and is spread on 3 pods. So when I send the "disable" request to the CB, actually, I'm only disabling one single instance. The two other ones are still active and can have their state changed. I guess, I will have to find another solution to globally disable the circuit breaker |
Is there any way to conditionally activate the |
No, unfortunately not.
If activated == true then ignore only a specific list of exceptions (com.test.exceptions.CardDisabledException, com.test.exceptions.CardNotFoundException, ...) |
That sounds like a really good idea, thanks. Do you think this trick would also ignore slow requests that also trigger the opening of the circuit ? |
Yes, it would ignore any exception. That means even TimeoutException would not increase the failure rate or the slow call rate. |
Thanks @RobWin. I will try that |
@RobWin Would you have any sample explaining how to implement the ignoreExceptionPredicate please ? I could not find anything in the doc. |
Similar to the failure rate predicate. |
Hi @RobWin
with the following configuration
When my env var Did I miss anything ? Thanks |
Are you sure that the slow requests are taken into account? This should not happen. Coud you debug or log it? |
Resilience4j version: 2.2.0
Java version: 17
After putting a circuit breaker instance to DISABLED state (using the transitionToDisabledState method), it is automatically moving to HALF_OPEN/OPEN when reaching the failure rate threshold.
Is it expected?
Is there any other way to disable a circuit breaker instance programmatically at runtime ?
Thanks 😊
The text was updated successfully, but these errors were encountered: