netty5/resolver-dns/src/main/java/io/netty/resolver/dns
Trustin Lee b2f1ef57c8 Fix RejectedExecutionException when using DnsAddressResolverGroup
Motivation:

AddressResolverGroup adds a listener to the termination future of an
EventExecutor when a new AddressResolver is created. The listener calls
AddressResolver.close() when the EventExecutor is terminated to give the
AddressResolver a chance to release its resources.

When using DnsAddressResolverGroup, the AddressResolver.close() will
eventually trigger DnsNameResolver.close(), which closes its underlying
DatagramChannel.

DatagramChannel.close() (or any Channel.close()) will travel through
pipeline and trigger EventExecutor.execute() because
DnsNameResolver.close() has been invoked from a non-I/O thread.
(NB: A terminationFuture is always notified from the GlobalEventExecutor
thread.)

However, because we are doing this in the listener of the termination
future of the terminated EventLoop we are trying to execute a task upon,
the attempt to close the channel fails due to RejectedExecutionException.

Modifications:

- Do not call Channel.close() in DnsNameResolver.close() if the Channel
  has been closed by EventLoop already

Result:

No more RejectedExecutionException when shutting down an event loop.
2016-08-01 10:21:10 +02:00
..
DefaultDnsCache.java Use shaded dependency on JCTools instead of copy and paste 2016-06-10 13:19:45 +02:00
DefaultDnsServerAddresses.java Replace infinite Iterable/Iterator with dedicated types 2015-08-26 17:38:43 +09:00
DnsAddressResolverGroup.java DnsNameResolver should not bind locally. Fixes #5457 Motivation: Dns resolution failures happen when using the DnsNameResolver and the JVM is not authorized to bind datagram channels. The current DnsNameResolver binds locally a DatagramChannel which is not necessary (and not always permitted). 2016-06-28 15:39:42 +02:00
DnsCache.java [#5088] Add annotation which marks packages/interfaces/classes as unstable 2016-05-09 15:16:35 +02:00
DnsCacheEntry.java [#5088] Add annotation which marks packages/interfaces/classes as unstable 2016-05-09 15:16:35 +02:00
DnsNameResolver.java Fix RejectedExecutionException when using DnsAddressResolverGroup 2016-08-01 10:21:10 +02:00
DnsNameResolverBuilder.java Allow ndots=0 in DnsNameResolver and search domains - fixes #5570 2016-07-24 20:41:14 +02:00
DnsNameResolverContext.java UnknownHostException mentions hostname with search domain added 2016-08-01 07:20:19 +02:00
DnsNameResolverException.java [#5088] Add annotation which marks packages/interfaces/classes as unstable 2016-05-09 15:16:35 +02:00
DnsQueryContext.java DnsNameResolver should not bind locally. Fixes #5457 Motivation: Dns resolution failures happen when using the DnsNameResolver and the JVM is not authorized to bind datagram channels. The current DnsNameResolver binds locally a DatagramChannel which is not necessary (and not always permitted). 2016-06-28 15:39:42 +02:00
DnsQueryContextManager.java Use separate query ID space for different DNS servers 2015-11-09 15:25:13 -08:00
DnsServerAddresses.java [#5088] Add annotation which marks packages/interfaces/classes as unstable 2016-05-09 15:16:35 +02:00
DnsServerAddressStream.java [#5088] Add annotation which marks packages/interfaces/classes as unstable 2016-05-09 15:16:35 +02:00
InflightNameResolver.java Do not send duplicate DNS queries when the same query is in progress already 2016-05-17 15:07:36 +02:00
NoopDnsCache.java [#5088] Add annotation which marks packages/interfaces/classes as unstable 2016-05-09 15:16:35 +02:00
package-info.java [#5088] Add annotation which marks packages/interfaces/classes as unstable 2016-05-09 15:16:35 +02:00
RotationalDnsServerAddresses.java Replace infinite Iterable/Iterator with dedicated types 2015-08-26 17:38:43 +09:00
SequentialDnsServerAddressStream.java Replace infinite Iterable/Iterator with dedicated types 2015-08-26 17:38:43 +09:00
ShuffledDnsServerAddressStream.java Replace infinite Iterable/Iterator with dedicated types 2015-08-26 17:38:43 +09:00
SingletonDnsServerAddresses.java Replace infinite Iterable/Iterator with dedicated types 2015-08-26 17:38:43 +09:00