-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Closed
Description
Version
Tested in all versions from 3.9.x to 4.5.x
Context
I encountered an exception which looks suspicious while using a simple lookup call to a public DNS using the DnsClient.
With this configuration:
DnsClient client = Vertx.vertx().createDnsClient(53, "212.27.40.240"); // Public DNS
When I execute a lookup with the DnsClient:
client.lookup("google.com")
Then I get this error:
io.vertx.core.VertxException: DNS query timeout for google.com.
at io.vertx.core.dns.impl.DnsClientImpl$Query.lambda$null$0(DnsClientImpl.java:352)
at io.vertx.core.impl.ContextInternal.dispatch(ContextInternal.java:264)
at io.vertx.core.impl.ContextInternal.dispatch(ContextInternal.java:246)
at io.vertx.core.impl.EventLoopContext.lambda$runOnContext$0(EventLoopContext.java:43)
at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:174)
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:167)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:569)
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.base/java.lang.Thread.run(Thread.java:833)
By activating DEBUG log on netty's classes, I get this:
11:36:59.222 [vert.x-eventloop-thread-0] [] DEBUG i.n.util.ResourceLeakDetectorFactory - Loaded default ResourceLeakDetector: io.netty.util.ResourceLeakDetector@51a297a1
11:36:59.228 [vert.x-eventloop-thread-0] [] DEBUG i.n.handler.logging.LoggingHandler - [id: 0xb1852f87] WRITE: DatagramPacket(=> /212.27.40.240:53, PooledUnsafeDirectByteBuf(ridx: 0, widx: 44, cap: 1024)), 44B
11:36:59.228 [vert.x-eventloop-thread-0] [] DEBUG i.n.handler.logging.LoggingHandler - [id: 0xb1852f87] FLUSH
io.vertx.core.VertxException: DNS query timeout for google.com.
at io.vertx.core.dns.impl.DnsClientImpl$Query.lambda$null$0(DnsClientImpl.java:352)
Note
If I use the Google DNS (8.8.8.8), everything works:
11:41:38.984 [vert.x-eventloop-thread-0] [] DEBUG i.n.util.ResourceLeakDetectorFactory - Loaded default ResourceLeakDetector: io.netty.util.ResourceLeakDetector@2de81aaa
11:41:38.990 [vert.x-eventloop-thread-0] [] DEBUG i.n.handler.logging.LoggingHandler - [id: 0xa830586a] WRITE: DatagramPacket(=> /8.8.8.8:53, PooledUnsafeDirectByteBuf(ridx: 0, widx: 44, cap: 1024)), 44B
11:41:38.991 [vert.x-eventloop-thread-0] [] DEBUG i.n.handler.logging.LoggingHandler - [id: 0xa830586a] FLUSH
11:41:39.019 [vert.x-eventloop-thread-0] [] DEBUG i.n.handler.logging.LoggingHandler - [id: 0xa830586a] READ: DatagramPacket(/8.8.8.8:53 => /0.0.0.0:58067, PooledUnsafeDirectByteBuf(ridx: 0, widx: 44, cap: 2048)), 44B
IP address is 142.250.74.238
11:41:39.023 [vert.x-eventloop-thread-0] [] DEBUG i.n.handler.logging.LoggingHandler - [id: 0xa830586a] READ COMPLETE
Increasing the timeout as no effect.
Do you have a reproducer?
https://github.com/phiz71/DebugDnsClient
Extra
I'm using OpenJDK 64-Bit Server VM Temurin-17.0.7+7