litellm/tests/test_litellm/proxy/db
devin-ai-integration[bot] 6e7984e537
fix(proxy): requeue spend logs when the DB write fails with a transport error (#36716)
* fix(proxy): requeue spend logs when the DB write fails with a transport error

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(proxy): hardcode the spend log queue cap and drop the stale re-export

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* refactor(proxy): keep the spend log requeue within the type discipline budget

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(proxy): apply the spend log queue cap to producer appends too

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(proxy): lower the spend log queue cap to 1k and make it env configurable

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(proxy): bound the spend log queue by bytes instead of row count

A row cap cannot bound memory: a row carries the whole prompt under store_prompts_in_spend_logs, so a cap that rides out an outage of counter-only rows is an OOM once prompts are stored. Every enqueue and dequeue now goes through one pair that tracks what the queue costs and drops the oldest rows past a 64 MB budget.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(proxy): make the spend log queue byte budget env configurable

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(proxy): use a string default for the spend log queue byte budget env read

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(proxy): make the spend log queue byte total a public attribute

The queue it accounts for is already public, and a private name only bought reportPrivateUsage errors at every call site.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: shivam <shivam@berri.ai>
2026-08-14 20:49:45 -07:00
..
db_transaction_queue Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_fix_redis_spend_buffer_requeue_33872 2026-08-14 19:07:19 +00:00
mcp_server build(VLLM-Passthrough-with-loadbalancing-support-(enables-using-model-list-for-VLLM-/classify-endpoint)): Closes #11205 2025-05-31 09:00:04 -07:00
conftest.py fix(tests): stop DATABASE_URL env pollution from read-replica tests breaking DB e2e tests (#32653) 2026-07-09 14:37:49 -07:00
test_autorouter_session_rollup.py feat: pre-adoption shadow eval for the auto-router (blind pairwise judge, derived state) (#36587) 2026-08-13 13:15:45 -07:00
test_check_migration.py build: migrate packaging, CI, and Docker from Poetry to uv (#25007) 2026-04-09 11:46:23 -07:00
test_create_views.py fix(proxy): guard every view creation, not just the first and last 2026-08-13 14:41:59 -07:00
test_daily_spend_bulk_upsert.py perf(spend): write each daily spend batch in one upsert statement (#36448) 2026-08-10 17:06:00 -07:00
test_db_spend_update_writer.py Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_fix_redis_spend_buffer_requeue_33872 2026-08-14 19:07:19 +00:00
test_db_url_settings.py fix(tests): stop DATABASE_URL env pollution from read-replica tests breaking DB e2e tests (#32653) 2026-07-09 14:37:49 -07:00
test_exception_handler.py fix(proxy): only treat a recoverable database outage as grounds to serve without one (#35864) 2026-08-05 14:15:13 -07:00
test_exception_handler_reconnect_retry.py fix(proxy): preserve original transport error if reconnect itself raises 2026-04-28 23:55:46 -07:00
test_gateway_request_tracking.py feat(sgr): make the gateway middleware the source of truth for successful requests (#35717) 2026-08-05 12:40:47 -07:00
test_prisma_client.py feat(db): opt-in REPLICA IDENTITY FULL after prisma migrations (#35267) 2026-07-30 15:45:40 -07:00
test_prisma_planned_engine_restart.py fix(proxy): stop alerting on health probes that lose the planned engine-restart race (#36141) 2026-08-07 09:57:30 -07:00
test_prisma_self_heal.py fix(proxy): only treat a recoverable database outage as grounds to serve without one (#35864) 2026-08-05 14:15:13 -07:00
test_query_engine_reaper.py fix(proxy_cli): reap orphaned prisma query-engine processes when a worker dies (#33424) 2026-07-16 13:16:41 -07:00
test_rds_iam_token_expiry.py fix(tests): stop DATABASE_URL env pollution from read-replica tests breaking DB e2e tests (#32653) 2026-07-09 14:37:49 -07:00
test_replica_identity.py feat(db): opt-in REPLICA IDENTITY FULL after prisma migrations (#35267) 2026-07-30 15:45:40 -07:00
test_routing_prisma_wrapper.py fix(tests): stop DATABASE_URL env pollution from read-replica tests breaking DB e2e tests (#32653) 2026-07-09 14:37:49 -07:00
test_spend_log_batching.py fix(proxy): requeue spend logs when the DB write fails with a transport error (#36716) 2026-08-14 20:49:45 -07:00
test_spend_log_tool_index.py fix(proxy): close the adversarial-review findings on the tool spend rollup 2026-07-26 01:55:47 -07:00
test_tool_registry_writer.py fix(proxy): self-heal startup/reload prisma reads on engine disconnect (#28803) 2026-06-10 20:16:58 +02:00