On 18/07/2016 13:55, Steffen Heil (Mailinglisten) wrote:
> 8.0.26

<snip/>

>> Tomcat version?

<snip/>

>>> I am getting the following exception:
>>>
>>> 2016-07-18 07:46:52.667 /http/httpmodule WARN null - error during
>>> upload
>>> | java.net.SocketTimeoutException
>>> |       at
>>> org.apache.tomcat.util.net.NioBlockingSelector.read(NioBlockingSelector
>>> .java:202)
>>> |       at
>>> org.apache.tomcat.util.net.NioSelectorPool.read(NioSelectorPool.java:25
>>> 0)
>>> |       at
>>> org.apache.tomcat.util.net.NioSelectorPool.read(NioSelectorPool.java:23
>>> 1)
>>> |       at
>>> org.apache.coyote.http11.InternalNioInputBuffer.fill(InternalNioInputBu
>>> ffer.java:133)
>>> |       at
>>> org.apache.coyote.http11.InternalNioInputBuffer$SocketInputBuffer.doRea
>>> d(InternalNioInputBuffer.java:177)
>>> |       at
>>> org.apache.coyote.http11.filters.IdentityInputFilter.doRead(IdentityInp
>>> utFilter.java:110)
>>> |       at
>>> org.apache.coyote.http11.AbstractInputBuffer.doRead(AbstractInputBuffer
>>> .java:416)
>>> |       at org.apache.coyote.Request.doRead(Request.java:469)
>>> |       at
>>> org.apache.catalina.connector.InputBuffer.realReadBytes(InputBuffer.jav
>>> a:342)
>>> |       at
>>> org.apache.tomcat.util.buf.ByteChunk.substract(ByteChunk.java:395)
>>> |       at
>>> org.apache.catalina.connector.InputBuffer.read(InputBuffer.java:367)
>>> |       at
>>> org.apache.catalina.connector.CoyoteInputStream.read(CoyoteInputStream.
>>> java:156)
>>>
>>> This happens when I try to read about 100MB from the client using
>>> (repeatedly) request..getInputStream().read(...).
>>> It happens 42 Seconds after the upload was started.
>>>
>>> I did not set any timeout on the connector and the default is supposed
>>> to be 60 seconds.
>>>
>>>
>>> So I have the following questions:
>>>
>>> 1. Does it make any sense to catch this exception and call read again?

No. Once you have an IOException you have to assume that the connection
is in an unknown state. The only safe option is to close the connection
and clean up.

>>> 2. Can I configure the read timeout on a per connection basis?

For standard, non-blocking Servlet I/O, no. But you can use
connectionUploadTimeout

>>> 3. Why is the exception thrown after just 42 seconds?

Are you sure you are using a connectionTimeout of 60s? Tomcat's default
server.xml overrides the default and sets a timeout of 20s.

There was some clean-up/fixes of timeouts in 8.5.x/9.0.x but, from
memory, that was related to some edge cases with non-blocking I/O so
won't affect the code above.

Mark


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to