liveBook · Manning

Open state

As explained in Python Concurrency with asyncio

The open state is the circuit-breaker state in which calls to a failing service are bypassed and fail immediately.

The open state is the circuit-breaker condition reached after repeated failures. Calls bypass the failing service and return an error immediately, preventing further delays for users. section 10.3.5

Opening after repeated failures

A breaker configured for two failures opens after the threshold is reached. Further requests fail instantly; after the reset interval, a request can test whether the service has recovered. section 10.3.5

Figure 10.3 A circuit breaker that opens after two failures. Once opened, all requests will fail instantly.
10-03

A state diagram shows the transition from closed to open after two failures and the resulting immediate request failures. section 10.3.5

How Python Concurrency with asyncio covers it

How deep it goes
Defines threshold-based opening and fail-fast calls, while deferring the half-open state in the simple implementation.
Examples
Demonstrates two failures opening a breaker, immediate subsequent failures, and recovery after a reset interval.
What it assumes
Assumes a slow or failing service and teaches the closed, open, and half-open state model.
What you can do after
Operate/configure a circuit breaker with failure limits, time windows, timeouts, and reset intervals.
How it connects
Connects circuit breaker pattern with closed state, half-open state, timeouts, and failure thresholds.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Python Concurrency with asyncio. The section links point to the parts of the book it draws on.