Excessive messageReceived event when use HttpMessageDecoder before ExecutionHandler
ekefly
jinjian.1 at gmail.com
Tue Aug 23 04:04:47 EDT 2011
Hi,
My pipeline looks like:
pipeline.addLast("decoder", new HttpRequestDecoder());
pipeline.addLast("encoder", new HttpResponseEncoder());
pipeline.addLast("executionHandler", _executionHandler);
pipeline.addLast("handler", _handler);
I used a too long HttpHeader for test using curl in which i set a header
larger than the default maxHeaderSize which is 8k.
1. Then i first receive a exception:
/HTTP header is larger than 8192 bytes.
org.jboss.netty.handler.codec.frame.TooLongFrameException: HTTP header is
larger than 8192 bytes.
at
org.jboss.netty.handler.codec.http.HttpMessageDecoder.readHeader(HttpMessageDecoder.java:531)
at
org.jboss.netty.handler.codec.http.HttpMessageDecoder.readHeaders(HttpMessageDecoder.java:447)
at
org.jboss.netty.handler.codec.http.HttpMessageDecoder.decode(HttpMessageDecoder.java:202)
at
org.jboss.netty.handler.codec.http.HttpMessageDecoder.decode(HttpMessageDecoder.java:107)
at
org.jboss.netty.handler.codec.replay.ReplayingDecoder.callDecode(ReplayingDecoder.java:461)
at
org.jboss.netty.handler.codec.replay.ReplayingDecoder.messageReceived(ReplayingDecoder.java:434)
at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:274)
at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:261)
at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:349)
at
org.jboss.netty.channel.socket.nio.NioWorker.processSelectedKeys(NioWorker.java:281)
at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:201)
at
org.jboss.netty.util.internal.IoWorkerRunnable.run(IoWorkerRunnable.java:46)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)/
2. close the channel in exceptionCaught(ChannelHandlerContext,
ExceptionEvent).
3. !! Received a truncated HttpRequest in messageReceived
DefaultHttpRequest(chunked: false)
GET /jk HTTP/1.1
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb:
.
I think this is caused by i used executionHandler and can not close the
channel ASAP, when exception occured and then i closed the channel,
HttpMessageDecoder is still working(NIOWorker) and decoded out a
HttpRequest.
My question: 1. If my analysis make sense
2. If i can place HttpMessageDecoder after ExecutionHandler, any performance
cost or concurrent issue?
Thanks
--
View this message in context: http://netty-forums-and-mailing-lists.685743.n2.nabble.com/Excessive-messageReceived-event-when-use-HttpMessageDecoder-before-ExecutionHandler-tp6715177p6715177.html
Sent from the Netty User Group mailing list archive at Nabble.com.
More information about the netty-users
mailing list