Infinite error loop on read time out.
infectedrhytms
infectedrhythms at hotmail.com
Wed May 5 20:35:19 EDT 2010
Using Netty 3.1.5 GA
What I'm doing is using Jmeter and purposely not sending the right length
message.
JMeter is set to not timeout. So when Netty gets a ReadTimout it close the
connection, but at the end of the test some Jmeter clients are still hung
until I close my netty application.
If I extend the ReadTimeoutHandler it looks as if Netty is getting into an
infinite loop and CPU hits 100%
If I use the normal ReadTimeoutHandler it seems to work correctly, but some
Jmeter clients get hung, until the server is closed... My pipeline is below
with some additional comments...
Also is there a good example on how to handle a read timeout?
This is my pipeline...
pipeline.addLast("framer", new
IntegerHeaderFrameDecoder(Constants.DefaultLengthHeader)); <-- My customer
header
pipeline.addLast("StringDecoder", StringDecoder);
//pipeline.addLast("timeout", new RequestReadTimeoutHandler(timer, 5)); <--
Tried extending ReadTimeoutHandler but this seems to cause the infninite
loop
pipeline.addLast("timeout", new ReadTimeoutHandler(timer, mpiReadTimeout,
TimeUnit.SECONDS)); <-- Is this in the right position of the pipeline? Seems
to work better then the above but some clients don't seem to get the close
packet.
pipeline.addLast("StringEncoder", StringEncoder);
pipeline.addLast("threaded", executionHandler);
pipeline.addLast("encoderdecoder", new MyObjectEncoderDecoder()); <-- My
custom encoder
pipeline.addLast("MyHandler", new MyHandler()); <-- Where the time out seems
to be caught.
@Override
public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e) {
Throwable t = e.getCause();
if(t instance ReadTimeoutException)
{
t.printStackTrace();
Channel ch = e.getChannel();
ch.close(); <-- Doesnt seem that all clients are getting the close. Some
clients still hang waiting for a close
}
}
--
View this message in context: http://netty-forums-and-mailing-lists.685743.n2.nabble.com/Infinite-error-loop-on-read-time-out-tp5008996p5011875.html
Sent from the Netty User Group mailing list archive at Nabble.com.
More information about the netty-users
mailing list