users@grizzly.java.net

Re: Timeout excpetion whith Grizzly 2.1.3

From: Oleksiy Stashok <oleksiy.stashok_at_oracle.com>
Date: Mon, 24 Oct 2011 14:55:33 +0200

Hi David,

looks like you're using blocking I/O when working with http-server module ;)
It's not something we're not suggesting, but definitely it's up to you.

To increase read timeout pls. try following:

             class MyHttpHandler extends HttpHandler {
                 @Override
                 public void service(final Request request, final
Response response) throws Exception {
                     
request.getContext().getConnection().setReadTimeout(value, TimeUnit);
                     ................
                 }
              }

WBR,
Alexey.

On 10/24/2011 02:30 PM, Gay David (Annecy) wrote:
>
> Hi all,
>
> I've got an exception in Grizzly 2.1.3 while under an heavy upload test.
>
> Basically, I've got this exception :
>
> java.io.IOException: java.util.concurrent.TimeoutException
>
> at
> org.glassfish.grizzly.nio.transport.TCPNIOTransportFilter.handleRead(TCPNIOTransportFilter.java:97)
>
> at
> org.glassfish.grizzly.filterchain.TransportFilter.handleRead(TransportFilter.java:182)
>
> at
> org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
>
> at
> org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:286)
>
> at
> org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:223)
>
> at
> org.glassfish.grizzly.filterchain.DefaultFilterChain.read(DefaultFilterChain.java:370)
>
> at
> org.glassfish.grizzly.filterchain.FilterChainContext.read(FilterChainContext.java:525)
>
> at
> org.glassfish.grizzly.http.server.io.InputBuffer.fill(InputBuffer.java:869)
>
> at
> org.glassfish.grizzly.http.server.io.InputBuffer.read(InputBuffer.java:331)
>
> at
> org.glassfish.grizzly.http.server.NIOInputStreamImpl.read(NIOInputStreamImpl.java:76)
>
> (...)
>
> Caused by: java.util.concurrent.TimeoutException
>
> at
> org.glassfish.grizzly.nio.tmpselectors.TemporarySelectorReader.read(TemporarySelectorReader.java:137)
>
> at
> org.glassfish.grizzly.nio.tmpselectors.TemporarySelectorReader.read(TemporarySelectorReader.java:85)
>
> at
> org.glassfish.grizzly.AbstractReader.read(AbstractReader.java:67)
>
> at
> org.glassfish.grizzly.nio.transport.TCPNIOTransportFilter.handleRead(TCPNIOTransportFilter.java:84)
>
> ... 14 more
>
> Have someone a clue what could be a possible cause ?
>
> Is there a property somewhere to increase the timeout ?
>
> And would it helps to increase this value or does it hide another
> problem ?
>
> Thanks for any tips.
>
> Regards
>
> David
>