I need to see the original exception with a full stack trace that
caused the i/o reactor to shut down and preferably the complete session
log leading to that condition.
Oleg
I was unable to get HttpClient5 logging to work. I used this config in
/WEB-INF/log4j2.xml. The log files get created, but they contain 0 output.
<Configuration>
<Appenders>
<File name="ctx" filename="/var/log/rst/httpcontext.log">
<PatternLayout pattern="%d %-5level [%logger] %msg%n%xThrowable" />
</File>
<File name="wire" filename="/var/log/rst/wire.log">
<PatternLayout pattern="%d %-5level [%logger] %msg%n%xThrowable" />
</File>
</Appenders>
<Loggers>
<Logger name="org.apache.hc.client5.http" level="DEBUG">
<AppenderRef ref="ctx"/>
</Logger>
<Logger name="org.apache.hc.client5.http.wire" level="DEBUG">
<AppenderRef ref="wire"/>
</Logger>
<Root level="INFO">
<AppenderRef ref="ctx" />
</Root>
</Loggers>
</Configuration>
I am able though to reproduce the error by shutting down the tomcat9
server that this httpclient is connecting to. After starting the server
up again, things work normal for a couple of minutes. Then I get this
exception (the cause is the strange part, )
...: Unable to connect to API Gateway
at com.rst.ResponseHolder.onCompleted(ResponseHolder.java:15)
at
org.asynchttpclient.AsyncCompletionHandler.onCompleted(AsyncCompletionHandler.java:66)
at
com.gold.ThrottleRequestFilter$AsyncHandlerWrapper.onCompleted(ThrottleRequestFilter.java:75)
at
org.asynchttpclient.netty.NettyResponseFuture.loadContent(NettyResponseFuture.java:222)
at
org.asynchttpclient.netty.NettyResponseFuture.done(NettyResponseFuture.java:257)
at
org.asynchttpclient.netty.handler.AsyncHttpClientHandler.finishUpdate(AsyncHttpClientHandler.java:241)
at
org.asynchttpclient.netty.handler.HttpHandler.handleChunk(HttpHandler.java:114)
at
org.asynchttpclient.netty.handler.HttpHandler.handleRead(HttpHandler.java:143)
at
org.asynchttpclient.netty.handler.AsyncHttpClientHandler.channelRead(AsyncHttpClientHandler.java:78)
at
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
at
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
at
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
at
io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)
at
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
at
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
at
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
at
io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:436)
at
io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:321)
at
io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:295)
at
io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:251)
at
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
at
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
at
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
at io.netty.handler.ssl.SslHandler.unwrap(SslHandler.java:1486)
at
io.netty.handler.ssl.SslHandler.decodeJdkCompatible(SslHandler.java:1235)
at io.netty.handler.ssl.SslHandler.decode(SslHandler.java:1282)
at
io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:498)
at
io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:437)
at
io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:276)
at
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
at
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
at
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
at
io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
at
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
at
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
at
io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
at
io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163)
at
io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:714)
at
io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:650)
at
io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:576)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493)
at
io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
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:834)
Caused by: org.apache.hc.core5.reactor.IOReactorShutdownException: I/O
reactor has been shut down
at org.apache.hc.core5.reactor.IOWorkers.validate(IOWorkers.java:51)
at org.apache.hc.core5.reactor.IOWorkers.access$000(IOWorkers.java:31)
at
org.apache.hc.core5.reactor.IOWorkers$PowerOfTwoSelector.next(IOWorkers.java:67)
at
org.apache.hc.core5.reactor.AbstractIOReactorBase.connect(AbstractIOReactorBase.java:53)
at
org.apache.hc.client5.http.impl.nio.MultihomeIOSessionRequester$1.executeNext(MultihomeIOSessionRequester.java:105)
at
org.apache.hc.client5.http.impl.nio.MultihomeIOSessionRequester$1.run(MultihomeIOSessionRequester.java:156)
at
org.apache.hc.client5.http.impl.nio.MultihomeIOSessionRequester.connect(MultihomeIOSessionRequester.java:160)
at
org.apache.hc.client5.http.impl.nio.MultihomeConnectionInitiator.connect(MultihomeConnectionInitiator.java:70)
at
org.apache.hc.core5.http2.nio.pool.H2ConnPool.connectSession(H2ConnPool.java:103)
at
org.apache.hc.core5.http2.nio.pool.H2ConnPool.connectSession(H2ConnPool.java:59)
at
org.apache.hc.core5.reactor.AbstractIOSessionPool.getSessionInternal(AbstractIOSessionPool.java:200)
at
org.apache.hc.core5.reactor.AbstractIOSessionPool.getSession(AbstractIOSessionPool.java:131)
at
org.apache.hc.client5.http.impl.async.InternalH2AsyncExecRuntime.acquireEndpoint(InternalH2AsyncExecRuntime.java:94)
at
org.apache.hc.client5.http.impl.async.AsyncConnectExec.execute(AsyncConnectExec.java:134)
at
org.apache.hc.client5.http.impl.async.AsyncExecChainElement.execute(AsyncExecChainElement.java:54)
at
org.apache.hc.client5.http.impl.async.AsyncExecChainElement$1.proceed(AsyncExecChainElement.java:62)
at
org.apache.hc.client5.http.impl.async.AsyncProtocolExec.internalExecute(AsyncProtocolExec.java:174)
at
org.apache.hc.client5.http.impl.async.AsyncProtocolExec.execute(AsyncProtocolExec.java:136)
at
org.apache.hc.client5.http.impl.async.AsyncExecChainElement.execute(AsyncExecChainElement.java:54)
at
org.apache.hc.client5.http.impl.async.AsyncExecChainElement$1.proceed(AsyncExecChainElement.java:62)
at
org.apache.hc.client5.http.impl.async.AsyncHttpRequestRetryExec.internalExecute(AsyncHttpRequestRetryExec.java:96)
at
org.apache.hc.client5.http.impl.async.AsyncHttpRequestRetryExec.execute(AsyncHttpRequestRetryExec.java:184)
at
org.apache.hc.client5.http.impl.async.AsyncExecChainElement.execute(AsyncExecChainElement.java:54)
at
org.apache.hc.client5.http.impl.async.AsyncExecChainElement$1.proceed(AsyncExecChainElement.java:62)
at
org.apache.hc.client5.http.impl.async.AsyncRedirectExec.internalExecute(AsyncRedirectExec.java:112)
at
org.apache.hc.client5.http.impl.async.AsyncRedirectExec.execute(AsyncRedirectExec.java:259)
at
org.apache.hc.client5.http.impl.async.AsyncExecChainElement.execute(AsyncExecChainElement.java:54)
at
org.apache.hc.client5.http.impl.async.InternalAbstractHttpAsyncClient$1.sendRequest(InternalAbstractHttpAsyncClient.java:186)
at
org.apache.hc.core5.http.nio.support.BasicRequestProducer.sendRequest(BasicRequestProducer.java:93)
at
org.apache.hc.client5.http.impl.async.InternalAbstractHttpAsyncClient.doExecute(InternalAbstractHttpAsyncClient.java:157)
at
org.apache.hc.client5.http.impl.async.CloseableHttpAsyncClient.execute(CloseableHttpAsyncClient.java:98)
at
org.apache.hc.client5.http.impl.async.CloseableHttpAsyncClient.execute(CloseableHttpAsyncClient.java:108)
at
org.apache.hc.client5.http.impl.async.CloseableHttpAsyncClient.execute(CloseableHttpAsyncClient.java:117)
at
com.rst.consumer.JsonTransmitter.sendRequest(JsonTransmitter.java:79)
---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org
For additional commands, e-mail: httpclient-users-h...@hc.apache.org