You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug: httpx.AsyncClient created per-request in server-https/app.py #75
server-https/app.py (line 202) creates a new httpx.AsyncClient on every incoming request rather than reusing a shared instance.
Problem
Every request opens a new connection pool and tears it down — redundant TLS handshakes, file descriptor churn, no benefit from HTTP keep-alive. Under any real load this becomes measurable overhead and can exhaust fd limits.
Why This Order
Same file as the CORS fix (#76) and replacing the linear query flow in server-https/app.py. Fix the client lifecycle first so subsequent changes don't build on top of the broken pattern.
Acceptance Criteria
A single httpx.AsyncClient is created at app startup via FastAPI lifespan
All route handlers reuse it via request.app.state
Client is properly closed on shutdown — no ResourceWarning in tests
Activity
perf(server): Initialize httpx.AsyncClient once per lifecycle to avoi…
fix(server-https): reuse shared httpx.AsyncClient instead of creating…
chasecadet commentedon Nov 20, 2026
Thank you for reporting this!
We are closing pre-restructure issues targeting the legacy
server/,server-https/,manifests/,kagent-feast-mcp/, or in-processSentenceTransformerprototype code. In #207, #210, #233, #240, and #249,kubeflow/docs-agentmigrated to dedicated TEI (text-embeddings-inference), FastMCP (docs-agent-mcp/mcp-server/), shared modular KFP pipelines (docs-agent-mcp/pipelines/), and Helm charts (docs-agent-mcp/charts/).If you still observe an equivalent issue on the current
mainstack, please feel free to open a new issue using the current issue templates.