Skip to content

feat: add resolveAll through Netty's configured resolver (DRIVER-201) - #1073

Draft
nikagra wants to merge 2 commits into
scylladb:scylla-4.xfrom
nikagra:s2/06-resolve-all
Draft

feat: add resolveAll through Netty's configured resolver (DRIVER-201)#1073
nikagra wants to merge 2 commits into
scylladb:scylla-4.xfrom
nikagra:s2/06-resolve-all

Conversation

@nikagra

@nikagra nikagra commented Sep 9, 2026

Copy link
Copy Markdown

Groundwork for expanding a contact-point hostname to every address it resolves to (next PR in the stack): nothing in the driver can ask Netty's configured resolver for all the addresses of a name, only for one, and only inside Bootstrap.connect().

  • ChannelFactory.resolveAll(SocketAddress) builds a bootstrap the way connect() does, runs NettyOptions.afterBootstrapInitialized on it, and asks the resolver that hook left installed, so a custom AddressResolverGroup is honoured.
  • The lookup runs on one pinned I/O event loop, never on the calling thread: AddressResolver#resolveAll resolves inline, and the default resolver blocks on the JDK lookup. A connect already pays that on an event loop, so this is parity, and the admin executor is left free.
  • The hook is asked once, not per lookup — one shaped bootstrap.resolver(new DnsAddressResolverGroup(...)) would otherwise mint a resolver, a socket and an empty DNS cache every time.
  • Netty's own short-circuits are mirrored: a disabled resolver, an unsupported address or one already resolved comes back as is, as the only element. Otherwise the resolver's answer is returned verbatim, immutable; a failure fails the stage, nothing throws, and no path can leave the stage incomplete.
  • No caller yet, no change to connect().

Verified: ChannelFactoryResolveAllTest (13 cases), the thread and hook-count cases proven red against the pre-change file; every existing ChannelFactory*Test unmodified and green; full core unit suite green (3981) on JDK 11. Not covered: no integration test — the caller in the next PR carries those.

Stacked on #1065 (s2/05-fallback-default); the first commit here is that PR's.

Refs: #890, #215

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Sep 9, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

nikagra and others added 2 commits September 11, 2026 01:01
The driver reconnects on addresses it resolved once and never re-reads
DNS (scylladb#215). Default `fallback-to-original-contact-points` to true: once a
reconnection round has exhausted the live nodes, the retained unresolved
contact points are tried again, so their names are resolved afresh. Init
and fallback build that plan through one path. isControlNode matches the
pending node by reference and re-checks the identified node, because the
endpoint equals() was a blocking lookup per event with unresolved
placeholders in the plan. A new MockResolverIT case covers recovery to
new addresses.

Fixes scylladb#215
Refs: scylladb#890

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
ChannelFactory.resolveAll(SocketAddress) asks the resolver the driver's
bootstrap would use for a connect, so a custom AddressResolverGroup
installed through NettyOptions.afterBootstrapInitialized is honoured,
for every address a name currently maps to. It mirrors Netty's own
short-circuits (disabled resolver, unsupported or already-resolved
address: the input as is). AddressResolver#resolveAll resolves inline,
so the lookup runs on one pinned I/O loop, never on the caller; the
hook is asked once. No caller yet: the contact-point expansion follows.

Refs: scylladb#890

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.

1 participant