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]

Merge pull request #39466 from BerriAI/litellm_prisma_timeout_killpg

Mateo Wangc053fac7b714
diff --cc litellm-proxy-extras/litellm_proxy_extras/utils.py
index a4ea4789b49,168c3febae2..71e7e9c683b
--- a/litellm-proxy-extras/litellm_proxy_extras/utils.py
+++ b/litellm-proxy-extras/litellm_proxy_extras/utils.py
@@@ -785,16 -735,12 +771,13 @@@ class ProxyExtrasDBManager
original_dir = os.getcwd()
os.chdir(migrations_dir)
deploy_timeout = prisma_migrate_deploy_timeout()
+ budget = _MigrateAttemptBudget(attempts_left=MAX_MIGRATE_DEPLOY_ATTEMPTS)
try:
- for attempt in range(4):
+ while not budget.exhausted:
try:
- result = subprocess.run(
+ result = prisma_toolchain.run_prisma(
[_get_prisma_command(), "migrate", "deploy"],
timeout=deploy_timeout,
- check=True,
- capture_output=True,
- text=True,
env=_get_prisma_env(),
)
logger.info(f"prisma migrate deploy stdout: {result.stdout}")