Also clear the authoritativeDnsServerCache when closing the Channel. (#8174)
Motivation: At the moment we only clear the resolveCache when the Channel is closed. We should also do the same for the authoritativeDnsServerCache. Modifications: Add authoritativeDnsServerCache.clear() to the Channel closeFuture. Result: Correctly clear all caches.
This commit is contained in:
parent
2c13f71c73
commit
55fec94592
@ -219,7 +219,7 @@ public class DnsNameResolver extends InetNameResolver {
|
||||
EventLoop eventLoop,
|
||||
ChannelFactory<? extends DatagramChannel> channelFactory,
|
||||
final DnsCache resolveCache,
|
||||
DnsCache authoritativeDnsServerCache,
|
||||
final DnsCache authoritativeDnsServerCache,
|
||||
DnsQueryLifecycleObserverFactory dnsQueryLifecycleObserverFactory,
|
||||
long queryTimeoutMillis,
|
||||
ResolvedAddressTypes resolvedAddressTypes,
|
||||
@ -306,8 +306,9 @@ public class DnsNameResolver extends InetNameResolver {
|
||||
|
||||
ch.closeFuture().addListener(new ChannelFutureListener() {
|
||||
@Override
|
||||
public void operationComplete(ChannelFuture future) throws Exception {
|
||||
public void operationComplete(ChannelFuture future) {
|
||||
resolveCache.clear();
|
||||
authoritativeDnsServerCache.clear();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user