Fail fast on empty round-robin address resolution#2254
Merged
Conversation
hyperxpro
force-pushed
the
fix/round-robin-empty-resolved-addresses
branch
from
July 18, 2026 21:10
3d4827e to
d681658
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.
Motivation:
PR #2229 changed round-robin mode to schedule the request timeout only once. As part of that change, the new-connection path assumes a successful DNS resolution always returns at least one address and unconditionally accesses the first entry. If a custom
NameResolverincorrectly reports success with an empty address list, this results in anIndexOutOfBoundsExceptionthat is swallowed by Netty, leaving the request future incomplete and no request timeout scheduled. The request then hangs until the caller's own timeout expires.Modification:
Guard the round-robin new-connection path against an empty resolved address list. If resolution succeeds with no addresses, fail the request immediately with an
UnknownHostExceptioncontaining the requested host instead of indexing into the list. Add a test covering a custom resolver that returns an empty successful result and verify the request fails fast instead of hanging.Result:
Round-robin requests now fail fast with a clear
UnknownHostExceptionwhen a resolver returns an empty address list, avoiding a swallowed exception and a hung request. Existing behavior for valid resolvers andDEFAULTmode is unchanged.