[
https://issues.apache.org/jira/browse/RATIS-2594?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18142700#comment-18142700
]
Haonan Hou commented on RATIS-2594:
-----------------------------------
Hi [~szetszwo] and [~adoroszlai] .
I checked how Ratis and Ozone use {{{}netty-resolver-dns-native-macos{}}}.
* *Ratis* uses the JDK for hostname resolution on its default paths. gRPC uses
grpc-java’s {{{}DnsNameResolver{}}}, which calls
{{{}InetAddress.getAllByName(){}}}. Netty RPC and DataStream use
{{{}NetUtils.createSocketAddr(){}}}, which calls
{{{}InetAddress.getByName(){}}}. I found no call sites for Netty’s async DNS
resolver in Ratis. [Ratis address
resolution|https://github.com/apache/ratis/blob/af50f2ddf/ratis-common/src/main/java/org/apache/ratis/util/NetUtils.java#L107-L123]
· [grpc-java address
resolution|https://github.com/grpc/grpc-java/blob/v1.82.4/core/src/main/java/io/grpc/internal/DnsNameResolver.java#L556-L563]
* *Ozone* has a build-time dependency on these files.
{{ozone-filesystem-shaded}} unpacks and renames both macOS DNS {{.jnilib}}
files from {{{}ratis-thirdparty-misc{}}}. I found no runtime call sites for the
Ratis-shaded provider in Ozone. I verified in a minimal Maven project that the
same rename plugin fails when a source file is missing. [OzoneFS build
configuration|https://github.com/apache/ozone/blob/2c1d40ace25eaede5ec853311ff43c6cac85e028/hadoop-ozone/ozonefs-shaded/pom.xml#L308-L347]
Would it make sense to remove both macOS classifiers from
{{ratis-thirdparty-misc}} and coordinate the removal of the two rename entries
when Ozone upgrades? This would also address the duplicate Maven metadata
warning for these artifacts. Does anyone know of a downstream runtime consumer
of the Ratis-shaded provider?
> Investigate usage of Netty native macOS DNS resolver
> ----------------------------------------------------
>
> Key: RATIS-2594
> URL: https://issues.apache.org/jira/browse/RATIS-2594
> Project: Ratis
> Issue Type: Improvement
> Components: Netty
> Reporter: Haonan Hou
> Priority: Minor
>
> After investigating the macOS Netty native DNS resolver packaged in
> {{{}ratis-thirdparty{}}}, it looks like it is not currently on Ratis’ default
> runtime path.
> {{ratis-thirdparty-misc}} packages {{{}netty-resolver-dns-native-macos{}}},
> but Ratis appears to rely on JDK-based DNS resolution today.
> Evidence:
> * Ratis gRPC channels are created through
> {{{}NettyChannelBuilder.forTarget(...){}}}.
> * gRPC Java resolves those targets through its internal
> {{{}DnsNameResolver{}}}, whose default address resolver uses
> {{{}InetAddress.getAllByName(...){}}}.
> * The non-gRPC Netty path resolves peer addresses through
> {{{}NetUtils.createSocketAddr(...){}}}, which uses
> {{{}InetAddress.getByName(...){}}}.
> * Netty {{Bootstrap}} also defaults to {{{}DefaultAddressResolverGroup{}}},
> which uses the JDK resolver unless a Netty DNS resolver group is explicitly
> configured.
> * There is no current usage of Netty {{DnsNameResolverBuilder}} or
> {{DnsAddressResolverGroup}} in Ratis.
> This seems to be historical behavior rather than an intentional design
> decision, since the native macOS DNS resolver library is already packaged in
> {{{}ratis-thirdparty{}}}.
> *Acceptance Criteria*
> * Decide whether Ratis should use Netty’s native macOS DNS resolver in any
> runtime path.
> * If yes, identify the appropriate gRPC and/or Netty integration points.
> * Preserve existing DNS behavior unless explicitly changed.
> * Document any limitations or configuration needed.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)