Open
Conversation
Add lazy DNS balancing for hostname upstreams in BalancedPool. When an upstream hostname resolves to multiple DNS records, new connections now rotate across the resolved addresses instead of always using a single result. This keeps the public BalancedPool API synchronous while deferring DNS resolution until connection time. Preserve the logical upstream origin so request Host headers and TLS servername handling continue to use the original hostname rather than the resolved IP address. Also add a regression test covering hostname upstream balancing across multiple resolved DNS records and verifying Host header preservation.
Member
|
can you update the docs? |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4971 +/- ##
=======================================
Coverage 92.96% 92.96%
=======================================
Files 111 110 -1
Lines 35842 35843 +1
=======================================
+ Hits 33320 33321 +1
Misses 2522 2522 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Add regression coverage for hostname DNS balancing in BalancedPool, including lookup errors, duplicate records, empty results, and the all-clients-busy path. Document that hostname upstreams are resolved lazily at connect time and that requests preserve the original Host header and TLS servername.
metcoder95
approved these changes
Apr 7, 2026
ronag
requested changes
Apr 7, 2026
Member
ronag
left a comment
There was a problem hiding this comment.
I think this would work better as an interceptor. IMHO balanced pool should be deprecated in favor of that.
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.
This relates to...
Rationale
BalancedPooltreated hostname upstreams as a single origin and did not spread new connections across all DNS records returned for that hostname. This change resolves hostname upstreams lazily at connect time and rotates connections across the resolved addresses without changing the synchronousBalancedPoolAPI.Changes
BalancedPoolHostheaders and TLSservernameFeatures
Bug Fixes
BalancedPoolnow balances hostname upstreams across resolved DNS records instead of reusing a single resolved addressHostand TLSservernamewhile connecting through the resolved IPsBreaking Changes and Deprecations
Status