os : macos vert.x version : 4.4.1 netty version: 4.1.90.Final
httpclient:
private HttpClient createSharedHttpClient() {
return vertx.createHttpClient(new HttpClientOptions()
.setShared(true)
//.setPoolEventLoopSize(0)
.setConnectTimeout(1000)
.setMaxPoolSize(1000)
// vertx will rename HTTP client option tryUseCompression to decompressionSupported
// https://github.com/eclipse-vertx/vert.x/issues/4022
.setTryUseCompression(true)
);
}
my operation step:
- The program starts and detects a service address at a regular interval of 5 seconds
- Disconnect the network actively. A request timeout occurs, followed by a SearchDomainUnknownHostException and DnsNameResolverTimeoutException
- The network is restored, but DNS Resolve times out and cannot be restored
16:07:47.408 [vert.x-eventloop-thread-3] ERROR c.a.s.f.ning.WrappedVertxHttpClient - [VertxHttpClient] Failed to request uri: https://dispatcher.xx.xx.com/xx/dispatcher, headers: {}
io.vertx.core.http.impl.NoStackTraceTimeoutException: The timeout of 5000 ms has been exceeded when getting a connection to dispatcher-sh.ls.apple.com:443
16:07:47.409 [vert.x-eventloop-thread-3] ERROR c.a.s.f.ning.WrappedVertxHttpClient - [VertxHttpClient] Failed to request uri: https://dispatcher.xx.xx.com/xx/dispatcher, headers: {}
io.netty.resolver.dns.DnsResolveContext$SearchDomainUnknownHostException: Failed to resolve 'dispatcher-sh.ls.apple.com' [A(1)] and search domain query for configured domains failed as well: [hz.ali.com]
at io.netty.resolver.dns.DnsResolveContext.finishResolve(DnsResolveContext.java:1088)
at io.netty.resolver.dns.DnsResolveContext.tryToFinishResolve(DnsResolveContext.java:1035)
at io.netty.resolver.dns.DnsResolveContext.query(DnsResolveContext.java:422)
at io.netty.resolver.dns.DnsResolveContext.access$700(DnsResolveContext.java:66)
at io.netty.resolver.dns.DnsResolveContext$2.operationComplete(DnsResolveContext.java:493)
at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:590)
at io.netty.util.concurrent.DefaultPromise.notifyListeners0(DefaultPromise.java:583)
at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:559)
at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:492)
at io.netty.util.concurrent.DefaultPromise.setValue0(DefaultPromise.java:636)
at io.netty.util.concurrent.DefaultPromise.setFailure0(DefaultPromise.java:629)
at io.netty.util.concurrent.DefaultPromise.tryFailure(DefaultPromise.java:118)
at io.netty.resolver.dns.DnsQueryContext.tryFailure(DnsQueryContext.java:261)
at io.netty.resolver.dns.DnsQueryContext$4.run(DnsQueryContext.java:208)
at io.netty.util.concurrent.PromiseTask.runTask(PromiseTask.java:98)
at io.netty.util.concurrent.ScheduledFutureTask.run(ScheduledFutureTask.java:153)
at io.netty.util.concurrent.AbstractEventExecutor.runTask$$$capture(AbstractEventExecutor.java:174)
at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java)
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute$$$capture(AbstractEventExecutor.java:167)
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:566)
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.lang.Thread.run(Thread.java:748)
Caused by: io.netty.resolver.dns.DnsNameResolverTimeoutException: [41848: /30.30.30.30:53] DefaultDnsQuestion(xx.xx.com.akadns.net. IN A) query '41848' via UDP timed out after 5000 milliseconds (no stack trace available)
When the network is restored, DNS Resolve and the request should be successful