Skip to content

fix(client): build connection pools only for UDP resolvers - #328

Merged
Mzack9999 merged 1 commit into
mainfrom
dwisiswant0/fix/client/build-connection-pools-only-for-udp-resolvers
Oct 25, 2026
Merged

Mzack9999 merged 1 commit into
mainfrom
dwisiswant0/fix/client/build-connection-pools-only-for-udp-resolvers

Conversation

@dwisiswant0

Copy link
Copy Markdown
Member

With ConnectionPoolThreads > 1, NewWithOptions built a UDP pool for
every base resolver, whatever its type. It read a DoH resolver's URL
as host:port, so NewWithOptions failed, either splitting a URL that
has a port or dialing the bogus address it got from one that
doesn't. TCP and DoT resolvers got pools that no query ever used.

Pool construction decided on its own which resolvers get a pool,
while exchange uses one only when clientFor picks udpClient. Build
pools for exactly the resolvers that clientFor sends through
udpClient, so the two decisions can't drift apart again. That rule
already covers Proxy, under which clientFor sends UDP resolvers over
TCP.

Fixes: #314

With ConnectionPoolThreads > 1, NewWithOptions built a UDP pool for
every base resolver, whatever its type. It read a DoH resolver's URL
as host:port, so NewWithOptions failed, either splitting a URL that
has a port or dialing the bogus address it got from one that
doesn't. TCP and DoT resolvers got pools that no query ever used.

Pool construction decided on its own which resolvers get a pool,
while exchange uses one only when clientFor picks udpClient. Build
pools for exactly the resolvers that clientFor sends through
udpClient, so the two decisions can't drift apart again. That rule
already covers Proxy, under which clientFor sends UDP resolvers over
TCP.

Fixes: #314
Signed-off-by: Dwi Siswanto <git@dw1.io>
@dwisiswant0
dwisiswant0 requested a review from Mzack9999 October 24, 2026 18:54
@Mzack9999
Mzack9999 merged commit 257ae08 into main Oct 25, 2026
5 checks passed
@Mzack9999
Mzack9999 deleted the dwisiswant0/fix/client/build-connection-pools-only-for-udp-resolvers branch October 25, 2026 10:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NewWithOptions fails for DoH resolvers when ConnectionPoolThreads > 1

2 participants