{"record":{"id":"ef36255f0437a5e6","repo":"BerriAI/litellm","slug":"redis-circuit-breaker-is-open-skipping-name","errorCode":null,"errorMessage":"Redis circuit breaker is open — skipping {name}","messagePattern":"Redis circuit breaker is open — skipping (.+?)","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"warning","filePath":"litellm/caching/redis_cache.py","lineNumber":232,"sourceCode":"    if not _is_redis_health_failure(exc):\n        return\n    breaker.record_failure()\n    _swallowed_redis_failures.set(_swallowed_redis_failures.get() + 1)\n\n\nasync def _run_under_circuit_breaker(\n    breaker: RedisCircuitBreaker,\n    name: str,\n    call: Callable[[], Awaitable[_RedisCallResult]],\n) -> _RedisCallResult:\n    \"\"\"Run one Redis coroutine under a circuit breaker.\n\n    Shared by the method decorator and the Lua script executor so both feed the same\n    health signal. Success is recorded only when nothing failed while ``call`` ran,\n    because several Redis methods catch their own connection errors and return a default.\n    \"\"\"\n    if breaker.is_open():\n        raise Exception(f\"Redis circuit breaker is open — skipping {name}\")\n    swallowed_before: Final = _swallowed_redis_failures.get()\n    try:\n        result: Final = await call()\n    except Exception as e:\n        if _is_redis_health_failure(e):\n            breaker.record_failure()\n        raise\n    if _swallowed_redis_failures.get() == swallowed_before:\n        breaker.record_success()\n    return result\n\n\ndef _redis_circuit_breaker_guard(method):\n    \"\"\"\n    Decorator for RedisCache async methods.\n    Checks the circuit breaker before each call; records success/failure after.\n    Does not apply to ping/disconnect/test_connection (health/teardown must always run).\n","sourceCodeStart":214,"sourceCodeEnd":250,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/caching/redis_cache.py#L214-L250","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Fix the underlying Redis connectivity (check Redis is up, reachable, and auth is correct) — the breaker closes itself once calls succeed again","Wait for the breaker cooldown window to elapse; do not spam retries while it is open","Scale or tune Redis (maxconnections, timeouts) if pool exhaustion is the root cause","If using Redis Sentinel/cluster, verify failover completed and the client refreshed its topology"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    await litellm.acompletion(...)\nexcept Exception as e:\n    if 'Redis circuit breaker is open' in str(e):\n        logger.warning('Redis temporarily unavailable (breaker open); backing off')\n        await asyncio.sleep(breaker_cooldown)\n        return await litellm.acompletion(...)  # single retry, not a tight loop","preventionTips":["Treat breaker-open as transient: back off, don't retry in a tight loop","Monitor Redis connection error rates so you see the failures that tripped the breaker","Keep Redis cache optional in your request path so chat calls survive Redis outages"],"tags":["redis","circuit-breaker","resilience","network","transient"],"backgroundTag":null,"analyzedSha":"6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d","analyzedAt":"2026-08-15T07:12:03.035Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}