Commit graph

19 commits

Author SHA1 Message Date
Ryan Crabbe
d6c6d12549 rename test file to test_redis_connection_pool.py 2026-02-20 17:10:08 -08:00
Ryan Crabbe
6931fea929 fix: close leaked Redis connection pools on cache eviction and disconnect
- RC1: Override _remove_key() in LLMClientCache to schedule aclose() on
  evicted async clients instead of relying on GC
- RC2: Use passed connection_pool for URL configs instead of creating an
  orphaned pool via from_url()
- RC3: Pass max_connections through to BlockingConnectionPool.from_url()
  for URL configs, with input validation for invalid values
- RC5: Close sync redis_client in disconnect() with try/except guard
2026-02-20 17:09:32 -08:00
Emerson Gomes
8a650f0170 fix(cache): prevent DualCache async batch check-then-act race (#20986)
* fix(cache): prevent dual cache batch redis race under concurrency

* chore(cache): remove unused dual cache batch key helper

* chore(cache): align dual cache type hints and throttle comment
2026-02-13 18:32:41 +05:30
Alexsander Hamir
727fe504bb
fix(redis): handle float redis_version from AWS ElastiCache Valkey (#16207)
* fix(redis): handle float redis_version from AWS ElastiCache Valkey

AWS ElastiCache Valkey returns redis_version as a float (7.0) instead
of a string ('7.0.0'), causing AttributeError: 'float' object has no
attribute 'split' in async_lpop when parsing version for LPOP count.

Changes:
- Extract version parsing into _parse_redis_major_version() helper
- Add DEFAULT_REDIS_MAJOR_VERSION constant (replaces magic number)
- Support multiple version formats: string, float, int, malformed
- Add comprehensive test coverage for all version format edge cases

Fixes: 'LiteLLM Redis Cache LPOP: - Got exception from REDIS' error
during db_spend_update_job cronjobs

* refactor: move DEFAULT_REDIS_MAJOR_VERSION to constants.py
2025-11-04 19:20:00 -08:00
malags
68189d1c04
[Performance] Reduce complexity of InMemoryCache.evict_cache from O(n*log(n)) to O(log(n)) (#15000)
* Improved performance by reducing complexity

* Improved logic to prevent memory from increasing too much, added test

* Restore indent

* Restore indent

* Added type annotation

* Updated test to correctly initialize the expiration_heap
2025-09-30 16:49:35 -07:00
Copilot
1816176f9d
[Memory Leak Fix] Fix InMemoryCache unbounded growth when TTLs are set (#14869)
* Initial plan

* Fix InMemoryCache unbounded growth issue when TTLs are set

Co-authored-by: ishaan-jaff <29436595+ishaan-jaff@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: ishaan-jaff <29436595+ishaan-jaff@users.noreply.github.com>
2025-09-24 11:54:06 -07:00
Michal Otmianowski
c444263e7d verify expires field prior to serving cache entry 2025-08-25 10:42:12 +02:00
Michal Otmianowski
a6f052882b fix test 2025-08-21 12:10:29 +02:00
Michal Otmianowski
feae09da5d minor adjustments 2025-08-21 11:33:11 +02:00
Michal Otmianowski
5dd7e00127 formatting adjustments 2025-08-21 11:27:12 +02:00
Michal Otmianowski
08c942c306 refactor tests 2025-08-21 10:38:43 +02:00
Michal Otmianowski
744dca1dc3 init asyc implementation 2025-08-21 10:22:54 +02:00
Michal Otmianowski
405e74ec16 use namespace as prefix in s3 2025-08-18 13:43:51 +02:00
Pascal Bro
a17d483c89
Add GCS bucket caching support (#13122) 2025-08-04 16:09:33 -07:00
Ishaan Jaff
311d356520 test_qdrant_semantic_cache_async_set_cache 2025-07-19 15:59:56 -07:00
Brian Caswell
45605f8362
add azure blob cache support (#12587)
* add support for Azure Blob caching

* add integration tests

* address feedback
2025-07-15 11:47:38 -07:00
Krish Dholakia
db23016536
fix(redis_cache.py): support pipeline redis lpop for older redis vers… (#11425)
* fix(redis_cache.py): support pipeline redis lpop for older redis versions

Fixes https://github.com/BerriAI/litellm/issues/10379

* test: add mock host
2025-06-05 00:05:54 -07:00
Krish Dholakia
ba39f9e360
Helicone base url support + fix for embedding cache hits on str input (#11211)
* fix(helicone.py): add helicone api base support

Fixes https://github.com/BerriAI/litellm/issues/10825

* test: add unit test for cache hit response on embedding calls

* fix(caching_handler.py): fix handling cache hit on embedding when input is string

Fixes LIT-197

* docs(helicone_integration.md): document new helicone api base param
2025-05-28 22:02:55 -07:00
Krish Dholakia
ef42461c1e
Litellm fix GitHub action testing (#11163)
* test: add __init__.py files

* refactor: rename test folder to avoid naming conflict

* test: update workflows

* test: update tests

* test: update imports

* test: update tests

* test: remove unused import

* ci(test-litellm.yml): add pytest retry to github workflow

* test: fix test
2025-05-26 14:41:42 -07:00