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.

a question about permittedNumberofCallsInHalfOpenstate

See original GitHub issue

Resilience4j version: 1.1.0

Java version: jdk1.8

@Bean
    public Customizer<ReactiveResilience4JCircuitBreakerFactory> defaultCustomizer() {
        return factory -> factory.configureDefault(id -> new Resilience4JConfigBuilder(id)
            .circuitBreakerConfig(CircuitBreakerConfig.custom()
                .automaticTransitionFromOpenToHalfOpenEnabled(true)
                .failureRateThreshold(50F)
                .waitDurationInOpenState(Duration.ofSeconds(60))
                .permittedNumberOfCallsInHalfOpenState(10)
                .minimumNumberOfCalls(100)
                .slidingWindowSize(500)
                .build())
            .timeLimiterConfig(TimeLimiterConfig.custom()
                .timeoutDuration(Duration.ofSeconds(300))
                .build())
            .build());
    }

If all the previous requests fail, when the service is restored, CircuitBreaker will enter a half-open state, allowing 10 requests to pass. if all of them are successful. Will the CircuitBreaker enter the closed state at this time? if the only refer failureRateThreshold, the CircuitBreaker will enter the open state at this time. how it works?

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
RobWincommented, Nov 5, 2020

No, the CircuitBreaker resets the failure rate when it transitions to HALF_OPEN. As soon as permittedNumberOfCallsInHalfOpenState calls (10) have been recorded, the failure rate is calculated. Which would be 0%, if the backend server is available again.

0reactions
DXGAMINGcommented, Dec 18, 2020

https://camel.apache.org/components/latest/eips/resilience4jConfiguration-eip.html You can find some description here

No, the CircuitBreaker resets the failure rate when it transitions to HALF_OPEN. As soon as permittedNumberOfCallsInHalfOpenState calls (10) have been recorded, the failure rate is calculated. Which would be 0%, if the backend server is available again.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How's the behaviour of circuit breaker in HALF_OPEN state ...
I've written a test with a mock server where I have permittedNumberOfCallsInHalfOpenState=2 Then I enqueue 3 calls ... Improve this question.
Read more >
Implementing a Circuit Breaker with Resilience4j - Reflectoring
permittedNumberOfCallsInHalfOpenState () configures the number of calls that will be allowed in the half-open state and ...
Read more >
Spring Boot Microservices Circuit breaker Resilience4j ...
To avoid this problem we can config one solution called Circuit ... 50 minimumNumberOfCalls: 5 permittedNumberOfCallsInHalfOpenState: 3 ...
Read more >
Getting Started - resilience4j
resilience4j.circuitbreaker: configs: default: slidingWindowSize: 100 permittedNumberOfCallsInHalfOpenState: 10 waitDurationInOpenState: 10000 ...
Read more >
Fault tolerance: Goodbye Hystrix, Hello Resilience4J!
permittedNumberOfCallsInHalfOpenState : 3 # Configures the number of ... PS If you have any questions about this or other topics please contact me...
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