Close delegate resolver from RoundRobinInetAddressResolver (#9214)
Motivation: RoundRobinDnsAddressResolverGroup ultimately opens UDP ports for DNS resolution. Callers likely expect that RoundRobinDnsAddressResolverGroup#close() will close those ports, but that is not currently true (see #9212). Modifications: Overrode RoundRobinInetAddressResolver#close() to close the delegate name resolver, which in turn closes any UDP ports used for name resolution. Result: RoundRobinDnsAddressResolverGroup#close() closes UDP ports as expected. This fixes #9212.
This commit is contained in:
parent
4ba75b99af
commit
26275e8a3d
@ -94,4 +94,9 @@ public class RoundRobinInetAddressResolver extends InetNameResolver {
|
||||
private static int randomIndex(int numAddresses) {
|
||||
return numAddresses == 1 ? 0 : ThreadLocalRandom.current().nextInt(numAddresses);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
nameResolver.close();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user