Read timeout errors in infinite loop

javadevmtl java.dev.mtl at gmail.com
Fri Aug 20 10:14:16 EDT 2010


I redid my stress test this time I added back the ReadTimeoutHandler but I'm
no longer dynamically removing it from the pipeline like I was doing before.
This time everything worked fine.

It's just a matter of understanding how it works and how it can be used...
My issue with the timer is the following or at least this is how I think it
works...

The moment the client connects the timer starts counting until "some"
packets come in. Once a couple of packets come in the timer is reset and
counts again. If I set the read timeout to say 3 seconds that means that
there will be a ReadTimeoutException thrown every 3 seconds. Sometimes my
business logic takes longer then 3 seconds to execute since it connects to
DB and other 3rd parties. So if it takes longer then 3 seconds I don't want
to timeout the client. Currently on ReadTimeOutException I close the socket.

So I figure what I can do is just set a higher read time out value like say
10 seconds and I'm ok. Like this I can also handle clients that potentially
don't send the "right" protocol/message to the server and I can clean them
up.
-- 
View this message in context: http://netty-forums-and-mailing-lists.685743.n2.nabble.com/Read-timeout-errors-in-infinite-loop-tp5440336p5444648.html
Sent from the Netty User Group mailing list archive at Nabble.com.


More information about the netty-users mailing list