Is there a way to react to a TooLongFrameException thrown by Netty?

404 views
Skip to first unread message

Anke Luedde

unread,
Oct 18, 2016, 12:21:23 PM10/18/16
to vert.x
Does Vertx offer a way to react to an exception thrown by Netty?


I'm sending a very long HTTP request (I've experimented with GET and DELETE) to my service.

The request does not get through to the service, but netty throws an exception: TooLongFramException (see below)
When looking into the netty code I see a comment in HttpObjectDecoder.HeaderParser.process():
"TODO: Response with Bad Request....“

I've opened an issue against netty, asking if the TODO will implemented somewhere in the (near) future.

17:46:05.836 [vert.x-eventloop-thread-0] ERROR io.vertx.core.logging.JULLogDelegate 167 log - io.netty.handler.codec.TooLongFrameException: An HTTP line is larger than 4096 bytes.
17:46:05.848 [vert.x-eventloop-thread-0] INFO  org.apache.kafka.clients.producer.KafkaProducer 613 close - Closing the Kafka producer with timeoutMillis = 9223372036854775807 ms.
17:46:05.847 [globalEventExecutor-1-3] ERROR io.netty.util.internal.logging.Slf4JLogger 181 error - Failed to submit a listener notification task. Event loop shut down? java.util.concurrent.RejectedExecutionException: event executor terminated
    at io.netty.util.concurrent.SingleThreadEventExecutor.reject(SingleThreadEventExecutor.java:840) ~[netty-common-4.1.3.Final.jar:4.1.3.Final]
    at io.netty.util.concurrent.SingleThreadEventExecutor.offerTask(SingleThreadEventExecutor.java:342) ~[netty-common-4.1.3.Final.jar:4.1.3.Final]
    at io.netty.util.concurrent.SingleThreadEventExecutor.addTask(SingleThreadEventExecutor.java:335) ~[netty-common-4.1.3.Final.jar:4.1.3.Final]
    at io.netty.util.concurrent.SingleThreadEventExecutor.execute(SingleThreadEventExecutor.java:765) ~[netty-common-4.1.3.Final.jar:4.1.3.Final]
    at io.netty.util.concurrent.DefaultPromise.safeExecute(DefaultPromise.java:767) [netty-common-4.1.3.Final.jar:4.1.3.Final]
    at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:435) [netty-common-4.1.3.Final.jar:4.1.3.Final]
    at io.netty.util.concurrent.DefaultPromise.setFailure(DefaultPromise.java:120) [netty-common-4.1.3.Final.jar:4.1.3.Final]
    at io.netty.channel.DefaultChannelPromise.setFailure(DefaultChannelPromise.java:87) [netty-transport-4.1.3.Final.jar:4.1.3.Final]
    at io.netty.channel.AbstractChannelHandlerContext.safeExecute(AbstractChannelHandlerContext.java:1022) [netty-transport-4.1.3.Final.jar:4.1.3.Final]
    at io.netty.channel.AbstractChannelHandlerContext.close(AbstractChannelHandlerContext.java:620) [netty-transport-4.1.3.Final.jar:4.1.3.Final]
    at io.netty.channel.AbstractChannelHandlerContext.close(AbstractChannelHandlerContext.java:475) [netty-transport-4.1.3.Final.jar:4.1.3.Final]
    at io.netty.channel.DefaultChannelPipeline.close(DefaultChannelPipeline.java:964) [netty-transport-4.1.3.Final.jar:4.1.3.Final]
    at io.netty.channel.AbstractChannel.close(AbstractChannel.java:234) [netty-transport-4.1.3.Final.jar:4.1.3.Final]
    at io.vertx.core.dns.impl.fix.DnsNameResolver.close(DnsNameResolver.java:281) [vertx-core-3.3.2.jar:?]
    at io.vertx.core.impl.AddressResolver$1$1.close(AddressResolver.java:148) [vertx-core-3.3.2.jar:?]
    at io.netty.resolver.AddressResolverGroup$1.operationComplete(AddressResolverGroup.java:79) [netty-resolver-4.1.3.Final.jar:4.1.3.Final]
    at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:514) [netty-common-4.1.3.Final.jar:4.1.3.Final]
    at io.netty.util.concurrent.DefaultPromise.notifyListeners0(DefaultPromise.java:507) [netty-common-4.1.3.Final.jar:4.1.3.Final]
    at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:486) [netty-common-4.1.3.Final.jar:4.1.3.Final]
    at io.netty.util.concurrent.DefaultPromise.access$000(DefaultPromise.java:34) [netty-common-4.1.3.Final.jar:4.1.3.Final]
    at io.netty.util.concurrent.DefaultPromise$1.run(DefaultPromise.java:438) [netty-common-4.1.3.Final.jar:4.1.3.Final]
    at io.netty.util.concurrent.GlobalEventExecutor$TaskRunner.run(GlobalEventExecutor.java:233) [netty-common-4.1.3.Final.jar:4.1.3.Final]
    at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:144) [netty-common-4.1.3.Final.jar:4.1.3.Final]
    at java.lang.Thread.run(Thread.java:785) [?:1.8.0]

Julien Viet

unread,
Oct 20, 2016, 5:43:52 PM10/20/16
to ve...@googlegroups.com
on which side are you getting this ?

--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.
Visit this group at https://groups.google.com/group/vertx.
To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/4168bcf3-8f4f-4005-8012-0c6f38131d7a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Anke Luedde

unread,
Oct 24, 2016, 3:21:41 AM10/24/16
to vert.x
it's on the client side

On my netty issue I got the recommendation to handle the exception by a ChannelHandler. I will go on with that suggestion.

Julien Viet

unread,
Oct 24, 2016, 7:43:50 AM10/24/16
to ve...@googlegroups.com
can you post the result of your experiment here ?

Mitch Walker

unread,
Feb 15, 2017, 1:33:54 PM2/15/17
to vert.x
I'm running into this as well and I'd like to be able to gracefully handle it (meaning return HTTP error).  As it is, the server hangs up on the client.  I know I can adjust it with setMaxInitialLineLength, but I'd like to be able to handle all cases.  Vertx doesnt catch and surface it either via the exceptionHandler or failedHandler.

Julien Viet

unread,
Feb 15, 2017, 2:46:04 PM2/15/17
to ve...@googlegroups.com
have you tried with 3.4.0.Beta1 ?

it fixed the following issues:


Julien

On Feb 15, 2017, at 7:33 PM, Mitch Walker <mitch....@gmail.com> wrote:

I'm running into this as well and I'd like to be able to gracefully handle it (meaning return HTTP error).  As it is, the server hangs up on the client.  I know I can adjust it with setMaxInitialLineLength, but I'd like to be able to handle all cases.  Vertx doesnt catch and surface it either via the exceptionHandler or failedHandler.

--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.
Visit this group at https://groups.google.com/group/vertx.

Mitch Walker

unread,
Feb 15, 2017, 3:26:24 PM2/15/17
to vert.x
ooh, thanks for that.  I'll try it out.  Is there a release timeframe for 3.4.0? Looks like beta was just released, so I imagine it needs to soak for a bit.

Julien Viet

unread,
Feb 15, 2017, 5:26:34 PM2/15/17
to ve...@googlegroups.com
it should be released around end of February.


Reply all
Reply to author
Forward
0 new messages