Skip to content

Commit 8957a2e

Browse files
violetaggwleese
andauthored
Improve logging when MacOSDnsServerAddressStreamProvider cannot be found/loaded (#12732)
Motivation: When `MacOSDnsServerAddressStreamProvider` cannot be found/loaded, a warning/error appears in the logs, specifying that without this functionality the DNS resolution might be incorrect. However there is no guidance how this can be fixed. Modifications: - Extend the log message with information for the dependency that is needed in order to resolve this issue. Result: Users will be informed for the missing dependency that will resolve the issue. Related to #11020 Co-authored-by: wvl <nlwilliam@icloud.com>
1 parent 57dbfb0 commit 8957a2e

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

resolver-dns/src/main/java/io/netty/resolver/dns/DnsServerAddressStreamProviders.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,12 @@ public Object run() {
6868
}
6969
} catch (ClassNotFoundException cause) {
7070
LOGGER.warn("Can not find {} in the classpath, fallback to system defaults. This may result in "
71-
+ "incorrect DNS resolutions on MacOS.", MACOS_PROVIDER_CLASS_NAME);
71+
+ "incorrect DNS resolutions on MacOS. Check whether you have a dependency on "
72+
+ "'io.netty:netty-resolver-dns-native-macos'", MACOS_PROVIDER_CLASS_NAME);
7273
} catch (Throwable cause) {
7374
LOGGER.error("Unable to load {}, fallback to system defaults. This may result in "
74-
+ "incorrect DNS resolutions on MacOS.", MACOS_PROVIDER_CLASS_NAME, cause);
75+
+ "incorrect DNS resolutions on MacOS. Check whether you have a dependency on "
76+
+ "'io.netty:netty-resolver-dns-native-macos'", MACOS_PROVIDER_CLASS_NAME, cause);
7577
constructor = null;
7678
}
7779
}

0 commit comments

Comments
 (0)