Spring / Resilience4j Interview questions
What is the difference between waitDurationInOpenState and permittedNumberOfCallsInHalfOpenState?
These two settings control different phases of recovery and are easy to conflate since they both govern "what happens after the breaker opens".
waitDurationInOpenState is a time value - how long the breaker stays fully OPEN, rejecting every call, before it's even eligible to move to HALF_OPEN and try anything again.
permittedNumberOfCallsInHalfOpenState is a count, not a time - once in HALF_OPEN, it's how many trial calls are allowed through before the breaker decides, based on their outcomes, whether to return to CLOSED or reopen.
Set together, they answer two separate questions: how long to wait before testing recovery at all, and how large a sample of real traffic to trust once that testing begins.
More Related questions...