Infinite error loop on read time out.

infectedrhytms infectedrhythms at hotmail.com
Wed May 5 10:09:01 EDT 2010


Hi I got an infinite loop on read time out error where the CPU just maxed at
100% and the error never stops printing...

Using Netty 3.1.5 GA

My pipeline

pipeline.addLast("framer", new
myHeaderDecoder(Constants.DefaultLengthHeader));
pipeline.addLast("StringDecoder", StringDecoder);
pipeline.addLast("timeout", new RequestReadTimeoutHandler(hashedWheelTimer,
timeout));		
pipeline.addLast("StringEncoder", StringEncoder);
pipeline.addLast("threaded", executionHandler);
pipeline.addLast("encoderdecoder", new MessageEncoderDecoder());
pipeline.addLast("MyHandler", new MyHandler());

The timeout handler...

@ChannelPipelineCoverage("one")
public class RequestReadTimeoutHandler extends ReadTimeoutHandler {

	private static final LogHelper logHelper = LogHelper.getInstance();
	
	public RequestReadTimeoutHandler(Timer timer, int timeoutSeconds) {
		super(timer, timeoutSeconds);
		// TODO Auto-generated constructor stub
	}

	@Override
	//In case of read timeout,send back a response and close the channel 
	protected void readTimedOut(ChannelHandlerContext ctx) {
		logHelper.logError("Read timeout error.");
		ChannelFuture cf =
ctx.getChannel().write(Constants.MPIRequestTooShortResponse);

		// Will close the channel once the write is done.
		cf.addListener(ChannelFutureListener.CLOSE);
		releaseExternalResources();
	}
	//It has already been processed, do not need to timeout again
	@Override
	public void messageReceived(ChannelHandlerContext ctx,
            MessageEvent e)
	{
		Object message = e.getMessage();
		logHelper.debug(message.getClass().toString());
		if (message instanceof String)
		{
			if(((String) message).length()>Constants.DefaultLengthHeader)
				releaseExternalResources();
		}
		Channels.fireMessageReceived(ctx, message);
	}
}

And basically "Read timeout error..." just keeps printing over and over on
the console window non stop and it never seems to stop...

Any ideas thanks
-- 
View this message in context: http://netty-forums-and-mailing-lists.685743.n2.nabble.com/Infinite-error-loop-on-read-time-out-tp5008996p5008996.html
Sent from the Netty User Group mailing list archive at Nabble.com.


More information about the netty-users mailing list