liveBook · Manning

Half-open state

As explained in gRPC Microservices in Go

A circuit-breaker operating state in which a limited number of requests are allowed to test whether a dependency has recovered.

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.

How gRPC Microservices in Go covers it

How deep it goes
Explains timeout-driven transitions, request limits, outcomes, and Go implementation points.
Examples
Uses a gobreaker configuration, an order-service client call, and a gRPC client interceptor.
What it assumes
Assumes circuit-breaker states and interservice communication, while defining half-open behavior from its transition rules.
What you can do after
Apply it via gobreaker to limit recovery probes and integrate circuit-breaking into Go or gRPC clients.
How it connects
Connects circuit breaker behavior with open state, closed state, timeout, MaxRequests, and client interceptors.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of gRPC Microservices in Go. The section links point to the parts of the book it draws on.