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.

Issue with minimum number of calls

See original GitHub issue

Resilience4j version: 1.7.0

Java version: 1.8

I have below set of properties in my application.properties for resilience4j.

resilience4j.circuitbreaker.instances.myService.minimum-number-of-calls=10 resilience4j.circuitbreaker.instances.myService.sliding-window-size=5 resilience4j.circuitbreaker.instances.myService.failure-rate-threshold=50 resilience4j.circuitbreaker.instances.myService.wait-duration-in-open-state=30000 resilience4j.circuitbreaker.instances.myService.automatic-transition-from-open-to-half-open-enabled=true resilience4j.circuitbreaker.instances.myService.permitted-number-of-calls-in-half-open-state=5

I am having below annotation over my method. @CircuitBreaker(name = "myService", fallbackMethod = "myServiceFallback")

I am having other service down and want to make all calls as failure.

As per doc even if all 9 calls are failures circuit will NOT go to open state. But in my case I am having first 6 failures in a raw. So total calls recorded are 6 and total failures are also 6. After 5th failure its going into open state. The 6th failure is giving me exception as io.github.resilience4j.circuitbreaker.CallNotPermittedException

It should go to open state after 10th failure.

I am not getting why this is happening ?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
dlsrb6342commented, Feb 24, 2021

No

If you set sliding-window-size greater than minimum-number-of-calls, CircuitBreakerState take your config as it. But if you set sliding-window-size less than minimum-number-of-calls, CircuitBreakerState take sliding-window-size as minimum-number-of-calls

Below is our implementation that I explained. https://github.com/resilience4j/resilience4j/blob/9ffb76906ac45d48cbcc0b1876d139eda9400d3e/resilience4j-circuitbreaker/src/main/java/io/github/resilience4j/circuitbreaker/internal/CircuitBreakerMetrics.java#L48-L51

1reaction
Romehcommented, Feb 24, 2021

because u r setting ur window size to 5 here : resilience4j.circuitbreaker.instances.myService.sliding-window-size=5

Read more comments on GitHub >

github_iconTop Results From Across the Web

CircuitBreaker - resilience4j
Configures the minimum number of calls which are required (per sliding window period) before the CircuitBreaker can calculate the error rate or slow...
Read more >
Resilience4J Circuitbreaker Configs not working properly #966
For example, if the minimum number of required calls is 10, then at least 10 calls must be recorded, before the failure rate...
Read more >
Difference between sliding window size and minimum number ...
Let's assume you have minimumNumberOfCalls=3, slidingWindowSize = 10 and slidingWindowType = COUNT_BASED: That means the CircuitBreaker is ...
Read more >
Resilience4j Configuration - Apache Camel
Configures the minimum number of calls which are required (per sliding window period) before the CircuitBreaker can calculate the error rate.
Read more >
Suppose that [math]n[/math] people each know exactly [math]1 ...
This is known as the Gossiping problem. The minimum number of calls is 0 for one person, 1 for two people, 3 for...
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