BerriAI/litellm · warning · Exception

Redis circuit breaker is open — skipping {name}

Error message

Redis circuit breaker is open — skipping {name}

What it means

LiteLLM wraps async Redis cache operations in a circuit breaker (RedisCircuitBreaker). When enough consecutive connection/health failures accumulate, the breaker opens and every subsequent Redis call fails fast with this exception instead of attempting a connection. The breaker resets automatically after its cooldown, so this is a transient protection error, not a permanent failure — but it indicates Redis was unreachable or failing just before.

Source

Thrown at litellm/caching/redis_cache.py:232

    if not _is_redis_health_failure(exc):
        return
    breaker.record_failure()
    _swallowed_redis_failures.set(_swallowed_redis_failures.get() + 1)


async def _run_under_circuit_breaker(
    breaker: RedisCircuitBreaker,
    name: str,
    call: Callable[[], Awaitable[_RedisCallResult]],
) -> _RedisCallResult:
    """Run one Redis coroutine under a circuit breaker.

    Shared by the method decorator and the Lua script executor so both feed the same
    health signal. Success is recorded only when nothing failed while ``call`` ran,
    because several Redis methods catch their own connection errors and return a default.
    """
    if breaker.is_open():
        raise Exception(f"Redis circuit breaker is open — skipping {name}")
    swallowed_before: Final = _swallowed_redis_failures.get()
    try:
        result: Final = await call()
    except Exception as e:
        if _is_redis_health_failure(e):
            breaker.record_failure()
        raise
    if _swallowed_redis_failures.get() == swallowed_before:
        breaker.record_success()
    return result


def _redis_circuit_breaker_guard(method):
    """
    Decorator for RedisCache async methods.
    Checks the circuit breaker before each call; records success/failure after.
    Does not apply to ping/disconnect/test_connection (health/teardown must always run).

View on GitHub (pinned to 6c2dcb801b)

Solutions

  1. Fix the underlying Redis connectivity (check Redis is up, reachable, and auth is correct) — the breaker closes itself once calls succeed again
  2. Wait for the breaker cooldown window to elapse; do not spam retries while it is open
  3. Scale or tune Redis (maxconnections, timeouts) if pool exhaustion is the root cause
  4. If using Redis Sentinel/cluster, verify failover completed and the client refreshed its topology
Defensive patterns

Strategy: retry

Try / catch

try:
    await litellm.acompletion(...)
except Exception as e:
    if 'Redis circuit breaker is open' in str(e):
        logger.warning('Redis temporarily unavailable (breaker open); backing off')
        await asyncio.sleep(breaker_cooldown)
        return await litellm.acompletion(...)  # single retry, not a tight loop

Prevention

When it happens

Trigger: Any awaited Redis cache operation (async_set_cache, async_get_cache, run_script, etc.) after a series of Redis connection errors/timeout trips the breaker. The call that raises this never touches Redis.

Common situations: Redis restarting, failover, network partition, TLS misconfiguration, or connection-pool exhaustion in high-traffic deployments; error appears in bursts then clears after the breaker half-opens.

Related errors


AI-assisted analysis of BerriAI/litellm@6c2dcb801b (2026-08-15). Data as JSON: /api/errors/ef36255f0437a5e6. Report an issue: GitHub.