refactor: introduce shared NetworkPool to manage and reuse HTTP transports across downloaders#410
Merged
SuperCoolPencil merged 2 commits intomainfrom Apr 24, 2026
Merged
Conversation
Binary Size Analysis
|
f0192b1 to
dc48652
Compare
…ports across downloaders
…onnsPerHost across downloaders and probes
c45df60 to
0aa6f73
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Greptile Summary
This PR replaces the per-downloader transport construction (and the old per-config
sync.Mapcache in the single downloader) with a centralizedNetworkPoolthat ref-counts leases and evicts idle transports after 10 seconds. Bootstrap and download clients in the concurrent downloader now share the same pool entry (both usePoolMaxConnsPerHost), resolving the previous key-mismatch concern. The probe layer drops its LRU client cache and acquires from the same pool per call.Confidence Score: 5/5
Safe to merge; the one remaining finding is a minor test consistency issue that does not affect correctness.
All previously raised P0/P1 concerns (IPv4 preference, test race, bootstrap/download key mismatch) are addressed or intentionally resolved. The only new finding is a P2 pool-key inconsistency in the prewarm test that doesn't affect production behavior.
internal/engine/concurrent/prewarm_reuse_test.go — pool key should match the one used in Download().
Important Files Changed
Prompt To Fix All With AI
Reviews (5): Last reviewed commit: "refactor: standardize network transport ..." | Re-trigger Greptile