Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] TimeoutExceptions and blocking read

Hi,

On Tue, Dec 3, 2013 at 3:39 PM, Máté Gulyás <gulyasm@xxxxxxxx> wrote:
> Hi!
>
> On our production server, I spot java.util.concurrent.TimoutExceptions
> in the server log. The stacktrace is below.
>
> java.io.IOException: java.util.concurrent.TimeoutException: Idle
> timeout expired: 30000/30000 ms
>         at org.eclipse.jetty.util.BlockingCallback.block(BlockingCallback.java:103)
>         at org.eclipse.jetty.server.HttpConnection$Input.blockForContent(HttpConnection.java:457)
>         at org.eclipse.jetty.server.HttpInput.read(HttpInput.java:130)
>         at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:283)
>         at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:325)
>         at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:177)
>         at java.io.InputStreamReader.read(InputStreamReader.java:184)
>         at java.io.BufferedReader.fill(BufferedReader.java:154)
>         at java.io.BufferedReader.read1(BufferedReader.java:205)
>         at java.io.BufferedReader.read(BufferedReader.java:279)
>         at java.io.Reader.read(Reader.java:100)
>         at com.google.common.io.CharStreams.copy(CharStreams.java:244)
>         at com.google.common.io.CharStreams.toStringBuilder(CharStreams.java:288)
>         at com.google.common.io.CharStreams.toString(CharStreams.java:262)
>         at mypackage.ForwardingHandler.handle(ForwardingHandler.java:72)
>         at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
>
> As far as I can tell, the timeouts happen because when the server
> tries to read the inputstream, the client does not send -1 or any
> data, so the reading operations blocks, and then the timeout occurs
> after 30 seconds.

That is correct.

> It occurs 100-200 times a day, the average load is around 1M-2.5M requests/day.

That's the 0.01% of the requests.

> My question is: Is there any way to prevent this? Am I missing something?

If you are sure that the client is misbehaving, there is nothing you
can do unless you also control the clients.
It's something that just happens.

-- 
Simone Bordet
----
http://cometd.org
http://webtide.com
http://intalio.com
Developer advice, training, services and support
from the Jetty & CometD experts.
Intalio, the modern way to build business applications.


Back to the top