mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-14 23:21:35 +00:00
The cascade zeroed end-user spend with a single update_many whose where clause enumerated every dependent user id. Prisma compiles that IN-list into one prepared statement carrying one bind variable per customer, and PostgreSQL caps a statement at 32,767 of them. Once a shared budget had more dependents than that the statement could not be parsed at all, so the atomic cascade rolled back, budget_reset_at never advanced, and the tier stayed due on every later tick forever. Customers sitting at their cap were blocked indefinitely with only a recurring log line to show for it. End users now match on budget_id like every other gated table, plus a NULL-budget_id branch for the implicitly created rows that carry no link and ride the default tier. The statement's bind count now tracks the number of expiring tiers rather than the customer population, so a reset costs the same whether a budget has ten dependents or a million. Fixes #40564 Claude-Session: https://claude.ai/code/session_01Hn5E8Jz1LjGLFyiYxBRcBW |
||
|---|---|---|
| .. | ||
| base_token_counter_test.py | ||
| conftest.py | ||
| log.txt | ||
| test_aiohttp_handler.py | ||
| test_anthropic_token_counter.py | ||
| test_aws_secret_manager.py | ||
| test_azure_ai_anthropic_token_counter.py | ||
| test_bedrock_token_counter.py | ||
| test_cyberark.py | ||
| test_get_secret.py | ||
| test_hashicorp.py | ||
| test_health_check.py | ||
| test_litellm_overhead.py | ||
| test_logging_callback_manager.py | ||
| test_proxy_budget_reset.py | ||
| test_secret_manager.py | ||
| test_utils.py | ||
| test_validate_tool_choice.py | ||
| vertex_key.json | ||