Skip to content

Commit

Permalink
Enabling DNS retryOnTimeout with TCP in DnsNameResolver (apache#23590)
Browse files Browse the repository at this point in the history
  • Loading branch information
graysonzeng authored Nov 13, 2024
1 parent 0f934f2 commit 5d924bf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,9 @@ public ConnectionPool(InstrumentProvider instrumentProvider,
private static AddressResolver<InetSocketAddress> createAddressResolver(ClientConfigurationData conf,
EventLoopGroup eventLoopGroup) {
DnsNameResolverBuilder dnsNameResolverBuilder = new DnsNameResolverBuilder()
.traceEnabled(true).channelType(EventLoopUtil.getDatagramChannelClass(eventLoopGroup));
.traceEnabled(true)
.channelType(EventLoopUtil.getDatagramChannelClass(eventLoopGroup))
.socketChannelType(EventLoopUtil.getClientSocketChannelClass(eventLoopGroup), true);
if (conf.getDnsLookupBindAddress() != null) {
InetSocketAddress addr = new InetSocketAddress(conf.getDnsLookupBindAddress(),
conf.getDnsLookupBindPort());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,8 @@ public ProxyService(ProxyConfiguration proxyConfig,
this.authenticationService = authenticationService;

DnsNameResolverBuilder dnsNameResolverBuilder = new DnsNameResolverBuilder()
.channelType(EventLoopUtil.getDatagramChannelClass(workerGroup));
.channelType(EventLoopUtil.getDatagramChannelClass(workerGroup))
.socketChannelType(EventLoopUtil.getClientSocketChannelClass(workerGroup), true);
DnsResolverUtil.applyJdkDnsCacheSettings(dnsNameResolverBuilder);

dnsAddressResolverGroup = new DnsAddressResolverGroup(dnsNameResolverBuilder);
Expand Down

0 comments on commit 5d924bf

Please sign in to comment.