Open phillbaker opened 7 years ago
Whether this behavior is correct can be questioned, but it surely is expected; since the circuit only opens and closes as response to succeeded/failed calls, if there are no calls, the circuit will stay in its current state.
I think it won't hurt to add the opened_at
metadata, but I wouldn't change the circuit state based on this information.
We currently monitor the state of several circuit breakers via the
current_state
attribute. However, we've noticed that if some of these connections have spiky traffic and trip the breaker, they can stay in the open state until another request is made which clears the state.The breaker itself is operating as expected, however, our monitoring records in correct data. What do you think of including a check of
_state_storage.opened_at
incurrent_state
? We're including this check in our code currently, but if this behavior at the library level seems incorrect I can open a PR.