Sometimes I can see a CallNotPermittedException with a message that says the circuit breaker is in HALF_OPEN state. But I don't understand how does it work in that state. I've written a test with a mock server where I have permittedNumberOfCallsInHalfOpenState=2 Then I enqueue 3 calls with a delay (3 seconds) and call, next call will fail with CallNotPermittedException and HALF_OPEN message. But if I wait the 3 seconds (enough for the calls to finish) and I do the next call, the CB is now in closed state. how's the transition from HALF_OPEN to another state ? does it wait for a time? or just "permittedNumberOfCallsInHalfOpenState" to finish ? then why I have to make 3 calls and not 2 ?
I'm using version 1.5