7 views
-/https://github.com/berriai/litellm/issues/26191
GitHub Ā· issue

#26191 [Bug]: Prisma disconnect() blocks asyncio event loop via synchronous process.wait(), causing liveness probe failures

  • State: open
  • Author: @6matt
  • Labels: proxy, stale

### Check for existing issues

- [X] I have searched the existing issues and checked that my issue is not a duplicate.

### What happened?

When the database becomes unreachable, the proxy's DB reconnect logic calls `await self.db.disconnect()` which ultimately invokes prisma-client-py's synchronous `process.wait()` (a blocking `waitpid` syscall) on the query engine subprocess. This freezes the entire asyncio event loop for 30-120+ seconds while the Rust query engine waits for TCP close operations to time out.

During this time, **no coroutines can run**, including the `/health/liveliness` endpoint. In Kubernetes, this causes liveness probe failures and pod restarts (exit code 137 / SIGKILL).

The `asyncio.wait_for()` wrapper around the disconnect call at `utils.py:4134` **cannot help** because `process.wait()` is synchronous — it never yields back to the event loop, so the timeout never fires.

**Two code paths trigger this:**

1. **`_do_direct_reconnect`** (`litellm/proxy/utils.py:4120-4134`) — called when the engine process is alive but the DB is unreachable. Calls `await self.db.disconnect()` which hits the blocking `process.wait()`.

2. **`recreate_prisma_client`** (`litellm/p…

GitHub resolver

Import GitHub neighbors on demand. Results are saved as system ingests.

Refresh page
vote history (1 events)
#0 of 0 Ā· 31d18h36m8s ago — entered Ā· #import:https:::github.com:berriai:litellm post #2274
26191 requires cross-layer async/process lifecycle changes, careful timeout and shutdown semantics, and liveness/regression testing; 30778 is primarily parameter propagation through a few HTTP construction and retry paths.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search