2012/3/30 Osipov, Michael <[email protected]>:
> Konstantin Kolinko wrote:
>> 2012/3/29 Osipov, Michael <[email protected]>:
>>> Hi folks,
>>>
>>> I am trying to narrow down an exception which is happening
>>> occasionally in certain spots of your code:
>>>
>>> SCHWERWIEGEND: Servlet.service() for servlet default threw exception
>>> Java.net.SocketTimeoutException
>>> at
>>> org.apache.coyote.http11.InternalAprInputBuffer.fill(InternalAprInputBuffer.java:796)
>>> ...
>>>
>>> The problematic spot in that file is:
>>> if ((-nRead) == Status.ETIMEDOUT || (-nRead) == Status.TIMEUP) {
>>> throw new
>>> SocketTimeoutException(sm.getString("iib.failedread"))
>>>
>>> Not to mention that 'iib.failedread' does not exists in the
>>> properties file, I cannot localize the failing point whether it's
>>> the client who's resetting/closing the connection or is it
>>> libtcnative?
>>
>>
>> It says "timeout" and it occurs while reading, so I would say that the
>> client is slow at delivering data (disappeared without closing the
>> connection), so read operation times out.
>>
>> The native side (network.c in native/branches/1.1.x/native/src) just
>> calls (tcn_nlayer_t)->recv, which has two different implementations,
>> depending on whether ssl is used or not used (network.c vs
>> sslnetwork.c).
>>
>>
>> The timeout on the socket should be configurable (probably see
>> AprEndpoint#setSocketOptions(..)), but I do not see specific mention
>> of that option in the documentation.
>>
>> It is a bit strange that soTimeout in setSocketOptions() is multiplied
>> by 1000. I'd expect the option to be in milliseconds, like documented
>> options. I cannot say without digging further into the code -- maybe
>> it is divided by 1000 somewhere else.
>
> According to Http11AprProtocol.java#L68 the default socket timeout is set to
> 60 000 milliseconds.
>
> The reson for x1000 is:
> /**
> * Setup socket timeout for the specified socket
> * @param sock The socket to set up.
> * @param t Value for the timeout in microseconds.
>
> So 60 seconds of timeout should be enough?
>
OK, understood. There is Collector.java L291
replacements.put("connectionTimeout", "soTimeout");
The "connectionTimeout" attribute of Connector in default server.xml
is explicitly configured to be 20000. I do not know what value is in
your server.xml file.
(This 20000 vs 60000 difference is known and is mentioned in TC7 docs).
Best regards,
Konstantin Kolinko
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]