I have an application where HTTP requests are initiated via a HTTP proxy. It seems to be working well when connections succeed, but during proxy failures(502, 403 etc from proxy), the Vertx (3.3.0) fails to report the failure and my application keeps waiting for the response. Luckily, Netty logs make it clear about the issue, but the application does not receive an event. This event would help as we may expect alternate proxy servers and the application can try the next in queue if one reports an error.
Below is from Netty stack trace:
[vert.x-eventloop-thread-2] WARN i.n.channel.DefaultChannelPipeline -
An exceptionCaught() event was fired, and it reached at the tail of the pipeline. It usually means the last handler in the pipeline did not handle the exception. io.netty.handler.proxy.ProxyConnectException: http, none, localhost/
127.0.0.1:3128 => target-server:8080, status: 403 Forbidden
at io.netty.handler.proxy.HttpProxyHandler.handleResponse(HttpProxyHandler.java:155) ~[netty-handler-proxy-4.1.1.Final.jar:4.1.1.Final]
at io.netty.handler.proxy.ProxyHandler.channelRead(ProxyHandler.java:259) ~[netty-handler-proxy-4.1.1.Final.jar:4.1.1.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [netty-transport-4.1.1.Final.jar:4.1.1.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:334) [netty-transport-4.1.1.Final.jar:4.1.1.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:326) [netty-transport-4.1.1.Final.jar:4.1.1.Final]
at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:428) [netty-transport-4.1.1.Final.jar:4.1.1.Final]
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:293) [netty-codec-4.1.1.Final.jar:4.1.1.Final]
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:267) [netty-codec-4.1.1.Final.jar:4.1.1.Final]
at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:243) [netty-transport-4.1.1.Final.jar:4.1.1.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [netty-transport-4.1.1.Final.jar:4.1.1.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:334) [netty-transport-4.1.1.Final.jar:4.1.1.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:326) [netty-transport-4.1.1.Final.jar:4.1.1.Final]
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1320) [netty-transport-4.1.1.Final.jar:4.1.1.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [netty-transport-4.1.1.Final.jar:4.1.1.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:334) [netty-transport-4.1.1.Final.jar:4.1.1.Final]
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:905) [netty-transport-4.1.1.Final.jar:4.1.1.Final]
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:123) [netty-transport-4.1.1.Final.jar:4.1.1.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:563) [netty-transport-4.1.1.Final.jar:4.1.1.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:504) [netty-transport-4.1.1.Final.jar:4.1.1.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:418) [netty-transport-4.1.1.Final.jar:4.1.1.Final]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:390) [netty-transport-4.1.1.Final.jar:4.1.1.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:742) [netty-common-4.1.1.Final.jar:4.1.1.Final]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_74]
Let me know if I missed anything / any workarounds / if an issue need to be raised.