fix(providers): increase HTTP connection pool for embedding provider#1123
fix(providers): increase HTTP connection pool for embedding provider#1123ronaldtangg wants to merge 1 commit into
Conversation
mrgoonie
left a comment
There was a problem hiding this comment.
Thanks for the focused fix. I confirmed the linked issue is real and this PR touches the right provider path, but I do not want to merge this as a bespoke transport literal yet.
Please align this with the repo-standard provider HTTP defaults instead of introducing a second, narrower transport shape here:
internal/providers/defaults.goalready centralizes provider transport behavior inNewDefaultTransport()/NewDefaultHTTPClient()with proxy support, stage timeouts, TLS handshake timeout, and keep-alive settings.- This PR's local
&http.Transport{MaxIdleConns: 100, MaxIdleConnsPerHost: 30, IdleConnTimeout: 90s}omits those shared defaults and will drift from the rest of the provider stack. - If embeddings genuinely need a higher per-host pool than the default 10, add a small named helper such as
NewEmbeddingHTTPClient()/NewEmbeddingTransport()that starts from the shared provider defaults and documents why embeddings use a higherMaxIdleConnsPerHost. - Please add a focused regression/unit test asserting the embedding provider client uses a transport with increased per-host idle capacity, so the starvation fix cannot silently regress.
After that alignment this should be mergeable.
|
🦸♂️ Maintainer check-in — PR #1123 has been in CHANGES_REQUESTED state for 2 days (since 2026-06-24) and the branch now has merge conflicts. @mrgoonie's review feedback is specific and actionable:
@ronaldtangg — the fix targets a real issue (connection pool starvation at >5 concurrent embedding requests) and the scope is small (+9/-2). Addressing the review feedback + resolving the merge conflict should get this close to merge-ready. Need any help? Posted by /github-maintain at $(date -u +%Y-%m-%dT%H:%M:%SZ) |
|
🦸♂️ Maintainer guidance — Good news: the review feedback from @mrgoonie is clear and actionable. Here is exactly what you need to do to get this merged: 1. Rebase onto current git fetch origin
git rebase origin/dev
git push --force-with-lease2. Replace bespoke transport with shared defaults client: NewDefaultHTTPClient(), // or NewDefaultTransport() + override MaxIdleConnsPerHostIf embeddings genuinely need a higher per-host pool than the default, create a small named helper like 3. Add a regression test This is a contained change — should be mergeable within a day after these adjustments. Let us know if you need help with the rebase! Posted by github-maintain at $(date -u +%Y-%m-%dT%H:%M:%SZ) |
clark-cant
left a comment
There was a problem hiding this comment.
🦸♂️ Maintainer review — Small, correct fix for HTTP connection pool starvation in the embedding provider.
Summary: Adds a custom http.Transport with MaxIdleConnsPerHost: 30 to prevent concurrent embedding requests from blocking.
Risk level: Low — single file, +9/-2, well-scoped.
Findings:
- Suggestion: The bare
http.Transport{}replaceshttp.DefaultTransportsettings. Consider preservingForceAttemptHTTP2: true,TLSHandshakeTimeout, andDialContextdefaults (or embed the default transport). Unlikely to cause issues for a single-endpoint embedding provider, but worth noting.
Verdict: Comment — Fix is correct and addresses a real production issue. Branch is stale (DIRTY merge state) and needs a rebase onto current dev before merge.
@ronaldtangg Could you rebase onto latest dev? The fix itself looks good.
Posted by github-maintain at 2026-06-29T16:10:00Z
Summary
Fix HTTP connection pool starvation in embedding provider that caused
team_tasks(action="search")to block when >5 concurrent requests hitthe embedding API simultaneously.
Type
Target Branch
devChecklist
go build ./...passesgo build -tags sqliteonly ./...passesgo vet ./...passes$1, $2(no string concat)Test Plan
team_tasks(action="search")