The half-open state lets a circuit breaker probe a recovered dependency without immediately restoring normal traffic. After the open-state timeout, configured requests pass through; success closes the circuit, while failure reopens it. section 6.1.3
Production configuration centers on controlled recovery:
- Set MaxRequests to limit how many requests may test the half-open circuit. section 6.1.3
- Set Timeout to determine when an open circuit becomes half-open. section 6.1.3
- Use the execution result to drive the state machine and let business logic choose the next step. section 6.1.3
Go client-side probe
A Go client can wrap an order-service call with gobreaker.Execute. The circuit breaker admits configured test requests, returns failures when the dependency remains unhealthy, and reports successful order creation normally.
