Microservices - Resilience Patterns
Consider this pseudocode for a circuit breaker:
if state == 'OPEN':
return 'fail fast'
elif state == 'HALF_OPEN':
if test_call_successful():
state = 'CLOSED'
else:
state = 'OPEN'
else:
call_service()
What happens when the circuit breaker is in HALF_OPEN state and the test call fails?