Apple Silicon triggers Unable to load io.netty.resolver.dns.macos.MacOSDnsServerAddressStreamProvider
See original GitHub issueWhen running Netty on Apple Silicon, this error is thrown:
i.n.r.d.DnsServerAddressStreamProviders : Unable to load io.netty.resolver.dns.macos.MacOSDnsServerAddressStreamProvider, fallback to system defaults. This may result in incorrect DNS resolutions on MacOS.
In https://github.com/netty/netty/issues/11020 the solution is provided. Which is to add this dependency:
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-resolver-dns-native-macos</artifactId>
<classifier>osx-aarch_64</classifier>
</dependency>
As a Spring Boot Webflux user, I see that reactor-netty-http pulls in io.netty:netty-resolver-dns-native-macos with classifier osx-x86_64. Reading the pom (https://search.maven.org/artifact/io.projectreactor.netty/reactor-netty-http/1.0.21/jar), this simply happens all the time, whatever arch you’re on.
Reading reactor-netty-core/build.gradle
however, I see some logic that tries to set this dynamically based on architecture.
It would seem however, that when the artifact is published to maven central, this logic is no longer present in the pom.
Expected Behavior
Reactor-netty-http when included as a dependency in another project on a Apple Silicon machine, should pull in io.netty:netty-resolver-dns-native-macos with classifier osx-aarch_64.
Actual Behavior
reactor-netty-http pulls in io.netty:netty-resolver-dns-native-macos with classifier osx-x86_64, no matter the actual architecture that’s in use.
Steps to Reproduce
The issue https://github.com/netty/netty/issues/11020 provides a repository and reproduction steps
Possible Solution
Include io.netty:netty-resolver-dns-native-macos both with classifier osx-x86_64 and osx-aarch_64. It seems that including osx-x86_64 on an m1 doesn’t do any harm, so I’m (possibly wrongly) assuming the reverse is also fine.
Your Environment
Apple Silicon
- Reactor version(s) used: 1.0.21
- Other relevant libraries versions (eg.
netty
, …): io.netty:netty-resolver-dns-classes-macos:jar:4.1.79.Final - JVM version (
java -version
): openjdk 17.0.3 - OS and version (eg.
uname -a
): Darwin xxx 21.6.0 Darwin Kernel Version 21.6.0: Wed Aug 10 14:28:23 PDT 2022; root:xnu-8020.141.5~2/RELEASE_ARM64_T6000 arm64 arm Darwin
Issue Analytics
- State:
- Created a year ago
- Reactions:2
- Comments:11 (6 by maintainers)
I proposed an improvement for the log message and this improvement will be in the next Netty 4.1.80.Final/5.0.0.Alpha5 https://github.com/netty/netty/pull/12732
The next step is to remove in version 2.0.x, the dependency to
netty-resolver-dns-native-macos
with classifierosx-x86_64
so that the users can specify the one that they need.Some of our users have strong requirements to not have unnecessary transitive dependencies so we are not going to add this additional dependency.