-
Notifications
You must be signed in to change notification settings - Fork 299
Open
Description
Summary
The AsyncOpenAI, Ollama, and VoyageAI embedders create HTTP clients that are never explicitly closed. Over time, connections accumulate in CLOSE_WAIT state and eventually exhaust available file descriptors.
Symptoms
Too many open fileserrors after prolonged operation- Connections stuck in
CLOSE_WAITstate (visible viass -tanornetstat) - Gradual file descriptor exhaustion under sustained embedding workloads
Root Cause
The embedder classes instantiate HTTP clients (e.g., httpx.AsyncClient via the OpenAI SDK, or direct httpx usage in Ollama/VoyageAI) but lack cleanup logic to close them when the embedding loop exits.
Proposed Fix
See PR #917, which:
- Adds a
cleanup()method to theEmbedderbase class - Implements
cleanup()in affected embedders to close underlying HTTP clients - Calls
cleanup()inExecutor.run()'sfinallyblock - Reuses client instances instead of creating new ones per request (Ollama, VoyageAI)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels