Add DefaultHostsFileEntriesResolver#addresses to provide all hosts file's entries for a hostname#11246
Add DefaultHostsFileEntriesResolver#addresses to provide all hosts file's entries for a hostname#11246normanmaurer merged 5 commits intonetty:4.1from violetagg:hosts-file-entries
Conversation
…le's entries for a hostname Motivation: DefaultHostsFileEntriesResolver should provide all hosts file's entries for a hostname when DnsNameResolver#resolveAll as opposed to the current implementation where only the first entry is taken into consideration Modification: - Add DefaultHostsFileEntriesResolver#addresses to provide all hosts file's entries for a hostname - Add HostsFileEntriesProvider to provide all hosts file's entries for a hostname and to keep backwards compatibility for HostsFileEntries and HostsFileParser - DnsNameResolver#resolveAll uses the new DefaultHostsFileEntriesResolver#addresses - BlockHound configuration: replace HostsFileParser#parse with HostsFileEntriesProvider$ParserImpl#parse as the latter does the parsing - Add junit tests Result: Fixes #10834
|
@normanmaurer How can I find the test that is not passing the build on CI? |
|
@violetagg it failed due some network problems: |
resolver/src/main/java/io/netty/resolver/DefaultHostsFileEntriesResolver.java
Show resolved
Hide resolved
resolver/src/main/java/io/netty/resolver/DefaultHostsFileEntriesResolver.java
Outdated
Show resolved
Hide resolved
resolver/src/main/java/io/netty/resolver/HostsFileEntriesProvider.java
Outdated
Show resolved
Hide resolved
normanmaurer
left a comment
There was a problem hiding this comment.
one nit... then I think we are ready to go
resolver/src/main/java/io/netty/resolver/DefaultHostsFileEntriesResolver.java
Outdated
Show resolved
Hide resolved
|
/cc @NiteshKant can you check as well ? |
normanmaurer
left a comment
There was a problem hiding this comment.
I think this is fine but one question left @violetagg that I am not sure about...
resolver-dns/src/main/java/io/netty/resolver/dns/DnsNameResolver.java
Outdated
Show resolved
Hide resolved
|
@normanmaurer @NiteshKant Thanks a lot! |
…le's entries for a hostname (#11246) Motivation: DefaultHostsFileEntriesResolver should provide all hosts file's entries for a hostname when DnsNameResolver#resolveAll as opposed to the current implementation where only the first entry is taken into consideration Modification: - Add DefaultHostsFileEntriesResolver#addresses to provide all hosts file's entries for a hostname - Add HostsFileEntriesProvider to provide all hosts file's entries for a hostname and to keep backwards compatibility for HostsFileEntries and HostsFileParser - DnsNameResolver#resolveAll uses the new DefaultHostsFileEntriesResolver#addresses - BlockHound configuration: replace HostsFileParser#parse with HostsFileEntriesProvider$ParserImpl#parse as the latter does the parsing - Add junit tests Result: Fixes #10834
|
@violetagg I need to investigate... with this change I see a test-failure in servicetalk... It seems to return the IPV6 address for localhost when we expect the IPV4. I need to investigate if the problem is with the test or the change here that it may return the IPV6 as first when we want the IPV4. |
if I can help just tell me ... |
|
@violetagg all good... I debugged a bit with the team and we are ok from a netty side.. |
That's good. Thanks |
…le's entries for a hostname (netty#11246) Motivation: DefaultHostsFileEntriesResolver should provide all hosts file's entries for a hostname when DnsNameResolver#resolveAll as opposed to the current implementation where only the first entry is taken into consideration Modification: - Add DefaultHostsFileEntriesResolver#addresses to provide all hosts file's entries for a hostname - Add HostsFileEntriesProvider to provide all hosts file's entries for a hostname and to keep backwards compatibility for HostsFileEntries and HostsFileParser - DnsNameResolver#resolveAll uses the new DefaultHostsFileEntriesResolver#addresses - BlockHound configuration: replace HostsFileParser#parse with HostsFileEntriesProvider$ParserImpl#parse as the latter does the parsing - Add junit tests Result: Fixes netty#10834 * Address feedback
Motivation:
DefaultHostsFileEntriesResolvershould provide all hosts file's entries for a hostname whenDnsNameResolver#resolveAllas opposed to the current implementation where only the firstentry is taken into consideration.
Modification:
DefaultHostsFileEntriesResolver#addressesto provide all hosts file's entries for a hostnameHostsFileEntriesProviderto provide all hosts file's entries for a hostname and to keepbackwards compatibility for
HostsFileEntriesandHostsFileParserDnsNameResolver#resolveAlluses the newDefaultHostsFileEntriesResolver#addressesBlockHoundconfiguration: replaceHostsFileParser#parsewithHostsFileEntriesProvider$ParserImpl#parseas the latter does the parsing
Result:
Fixes #10834