The current CircuitBreaker code currently correctly detects the current
state from the provided state storage object and uses it to construct
the internal state object. However when the detected state is "closed",
the newly instantiated CircuitClosedState will reset the fail counter
on the breaker.
These changes move the reset_counter() call into the notify block.
This issue was called out in #26, but was not addressed in #27.
The current CircuitBreaker code currently correctly detects the current state from the provided state storage object and uses it to construct the internal state object. However when the detected state is "closed", the newly instantiated
CircuitClosedState
will reset the fail counter on the breaker.These changes move the
reset_counter()
call into the notify block.This issue was called out in #26, but was not addressed in #27.