Course contentsShow
← System Design
Lesson 1047 of 1,91927. Circuit Breakers and BulkheadsFree lesson

The Three States: Half-Open

Understanding the Half-Open state where limited test requests are allowed to check if the downstream service has recovered.

The Three States: Half-Open

You'll learn how the Half-Open state acts as a testing phase, allowing the circuit breaker to probe whether a failing service has recovered.

What Is the Half-Open State?

After a circuit breaker has been Open for a configured timeout period, it doesn't immediately close and flood the downstream service with requests. Instead, it transitions to Half-Open—a cautious middle ground where it allows a limited number of test requests through.

Think of it like cracking open a door before fully opening it. You don't throw it wide open immediately; you peek through to see if it's safe.

How Half-Open Works

In the Half-Open state:

  1. Limited test requests are permitted (often just one, or a small percentage)
  2. The circuit breaker monitors these test requests closely
  3. If they succeed: The service appears healthy, so the breaker transitions back to Closed
  4. If they fail: The service is still unhealthy, so the breaker returns to Open and waits longer before trying again

This prevents overwhelming a struggling service while still checking if it has recovered.

Why This State Matters

Without Half-Open, you face two bad options:

  • Stay Open forever (manual intervention required)
  • Jump straight to Closed and risk immediately overwhelming a barely-recovered service

Half-Open provides safe recovery testing—you verify health with minimal risk before resuming normal traffic flow.

Tuning Half-Open Behavior

Common configuration parameters:

  • Number of test requests allowed
  • Success threshold (e.g., 3 out of 5 must succeed)
  • Timeout before entering Half-Open from Open

Key Takeaway: The Half-Open state is a critical safety mechanism that allows circuit breakers to automatically test service recovery with minimal risk, enabling self-healing without manual intervention or dangerous traffic spikes.