Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

fix(redis): route the per-TTL pipeline write timeout log through the shared throttle

yassinc4354c248a78
diff --git a/litellm/caching/redis_cache.py b/litellm/caching/redis_cache.py
index 3c3539eb8a9..b4b2b1a334c 100644
--- a/litellm/caching/redis_cache.py
+++ b/litellm/caching/redis_cache.py
@@ -1231,8 +1231,11 @@ class RedisCache(BaseCache):
end_time=time.time(),
)
)
- verbose_logger.error(
- "LiteLLM Redis Caching: async_set_cache_pipeline_with_ttls() - Got exception from REDIS %s", str(e)
+ log_redis_failure(
+ verbose_logger,
+ logging.ERROR,
+ "LiteLLM Redis Caching: async_set_cache_pipeline_with_ttls() - Got exception from REDIS",
+ e,
)
_record_swallowed_redis_failure(self._circuit_breaker, e)
diff --git a/tests/test_litellm/caching/test_redis_cache.py b/tests/test_litellm/caching/test_redis_cache.py
index 9fdddd3c085..19638c60b4b 100644
--- a/tests/test_litellm/caching/test_redis_cache.py
+++ b/tests/test_litellm/caching/test_redis_cache.py
@@ -1260,6 +1260,10 @@ def test_timeouts_during_a_blip_log_once_per_interval_not_once_per_call(sync_bat
"call_method",
[
pytest.param(lambda c: c.async_set_cache_pipeline([("lit7520", "v")]), id="async_set_cache_pipeline"),
+ pytest.param(
+ lambda c: c.async_set_cache_pipeline_with_ttls([("lit7520", "v", 60.0)]),
+ id="async_set_cache_pipeline_with_ttls",
+ ),
pytest.param(lambda c: c.async_set_cache_sadd("lit7520", ["v"], ttl=None), id="async_set_cache_sadd"),
pytest.param(lambda c: c.async_increment("lit7520", 1.0), id="async_increment"),
pytest.param(