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
clark-cant
left a comment
There was a problem hiding this comment.
Review — github-maintain
Summary: Increases HTTP connection pool for the embedding provider to prevent connection pool starvation when >5 concurrent requests hit the embedding API (e.g., team_tasks search).
Risk level: Low — 1 file, +9/-2 lines, adds a custom http.Transport with reasonable pool limits.
Mandatory gates:
- Duplicate/prior implementation: ✅ clear — no duplicate PR found; companion issue #1124 documents the bug
- Project standards: ✅ clear — follows Go http.Client patterns
- Strategic necessity: ✅ clear value — fixes a P1-high production blocker (concurrent requests hanging indefinitely)
Findings:
- No Critical or Important issues
- The pool values (MaxIdleConns=100, MaxIdleConnsPerHost=30, IdleConnTimeout=90s) are reasonable defaults
- Suggestion: consider making pool size configurable via env var for deployments with different concurrency profiles, but not blocking
Verdict: Approve — clean fix, correct approach.
Note: mergeStateStatus is DIRTY — branch needs rebase onto dev before merge.
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.
Review: fix(providers) increase HTTP connection pool for embedding provider
Summary: Adds a custom http.Transport with MaxIdleConnsPerHost: 30 to the embedding provider's HTTP client to prevent connection pool starvation under concurrent load.
Risk level: Low — single-file change, well-scoped, correct approach.
Mandatory gates:
- Duplicate/prior implementation: clear — no prior PR addresses embedding pool sizing
- Project standards: inferred from codebase patterns
- Strategic necessity: clear value — fixes
team_tasks(action="search")blocking under concurrency
Findings
Suggestion
- The transport settings are reasonable (
MaxIdleConns: 100,MaxIdleConnsPerHost: 30,IdleConnTimeout: 90s). Consider making these configurable via provider options if other embedding providers need different tuning, but not required for this fix. - No tests cover the pool behavior — a unit test asserting the transport is configured correctly would prevent regression, but the fix itself is safe to merge as-is.
Verdict: Comment — safe to merge, but branch needs rebase
The fix is correct and addresses a real production issue. However:
- Branch is stale (
mergeStateStatus: DIRTY) — needs rebase onto currentdevbefore merge - No CI checks have run — once rebased, CI should be triggered to verify
After rebase, this is a clean approve.
Posted by github-maintain cron at 2026-07-17T17:51:02Z
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")