Re: Chasing a SocketTimeoutException with APR

2012-04-02 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Micheal,

On 3/30/12 3:37 AM, Osipov, Michael wrote:
 Pid * wrote:
 Can you switch to the NIO connector and see if a similar issue
 occurs?
 
 Not on the production system. We are using APR with SSL, so I did
 not create Java compatible SSL keys. I can try on an integration
 system but this error happens sporadically on this method.

FWIW, you should be able to convert SSL keys between formats using
keytool and openssl.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk96A/cACgkQ9CaO5/Lv0PCnuACfaiuZYGcvNavA9Z5Upf7QziFl
RD8An12MqpkAgPLBgII0zwcvuXAEOFoG
=8J3W
-END PGP SIGNATURE-

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



Re: Chasing a SocketTimeoutException with APR

2012-04-02 Thread Felix Schumacher


Christopher Schultz ch...@christopherschultz.net schrieb:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Micheal,

On 3/30/12 3:37 AM, Osipov, Michael wrote:
 Pid * wrote:
 Can you switch to the NIO connector and see if a similar issue
 occurs?
 
 Not on the production system. We are using APR with SSL, so I did
 not create Java compatible SSL keys. I can try on an integration
 system but this error happens sporadically on this method.

FWIW, you should be able to convert SSL keys between formats using
keytool and openssl.
You could even try to set/change the keystoreType atribute of the connector to 
pkcs12.  That way you should be able to use the openssl keystore directly.

Regards
 Felix

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk96A/cACgkQ9CaO5/Lv0PCnuACfaiuZYGcvNavA9Z5Upf7QziFl
RD8An12MqpkAgPLBgII0zwcvuXAEOFoG
=8J3W
-END PGP SIGNATURE-

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



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



Re: Chasing a SocketTimeoutException with APR

2012-03-30 Thread Pid *
On 29 Mar 2012, at 12:57, Osipov, Michael michael.osi...@siemens.com wrote:

 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?
 My client code does this:
 private JSONObject getJSON(HttpServletRequest request) throws IOException {
String jsonBody = IOUtils.toString(request.getInputStream(), UTF-8);
return JSONObject.fromObject(jsonBody);
}

 Is there any clue where I can start digging for this problem? If the client 
 (IE) is failing, I can't do anything about it but if my code is the problem...

Can you switch to the NIO connector and see if a similar issue occurs?


p



 I am on
 bash $ uname -a
 HP-UX blnn725x B.11.23 U ia64
 bash $ /opt/java6/bin/java -version
 java version 1.6.0.13
 Java(TM) SE Runtime Environment (build 1.6.0.13-jinteg_01_dec_2011_03_39-b00)
 Java HotSpot(TM) Server VM (build 20.3-b02-jre1.6.0.13-rc1b1, mixed mode)
 Tomcat 6.0.35
 Libtcnative 1.1.22
 Client IE8 on Windows XP.

 With best regards,
 Michael 
 OsipovТ�ХF�V�7V'67�R�R���âW6W'2�V�7V'67�TF��6B�6�R��pФf�FF�F����6����G2�R���âW6W'2ֆV�F��6B�6�R��pР

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



RE: Chasing a SocketTimeoutException with APR

2012-03-30 Thread Osipov, Michael
Pid * wrote:
 On 29 Mar 2012, at 12:57, Osipov, Michael
 michael.osi...@siemens.com wrote: 
 
 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?   
 My client code does this:
 private JSONObject getJSON(HttpServletRequest request) throws
IOException { String jsonBody =
IOUtils.toString(request.getInputStream(), UTF-8); return
JSONObject.fromObject(jsonBody); }
 
 Is there any clue where I can start digging for this problem? If the
 client (IE) is failing, I can't do anything about it but if my code
 is the problem...  
 
 Can you switch to the NIO connector and see if a similar issue occurs?

Not on the production system. We are using APR with SSL, so I did not create 
Java compatible SSL keys.
I can try on an integration system but this error happens sporadically on this 
method.

Mike

Re: Chasing a SocketTimeoutException with APR

2012-03-30 Thread Konstantin Kolinko
2012/3/29 Osipov, Michael michael.osi...@siemens.com:
 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.

 My client code does this:
 private JSONObject getJSON(HttpServletRequest request) throws IOException {
                String jsonBody = IOUtils.toString(request.getInputStream(), 
 UTF-8);
                return JSONObject.fromObject(jsonBody);
        }

 Is there any clue where I can start digging for this problem? If the client 
 (IE) is failing, I can't do anything about it but if my code is the problem...

 I am on
 bash $ uname -a
 HP-UX blnn725x B.11.23 U ia64
 bash $ /opt/java6/bin/java -version
 java version 1.6.0.13
 Java(TM) SE Runtime Environment (build 1.6.0.13-jinteg_01_dec_2011_03_39-b00)
 Java HotSpot(TM) Server VM (build 20.3-b02-jre1.6.0.13-rc1b1, mixed mode)
 Tomcat 6.0.35
 Libtcnative 1.1.22
 Client IE8 on Windows XP.


Best regards,
Konstantin Kolinko

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



RE: Chasing a SocketTimeoutException with APR

2012-03-30 Thread Osipov, Michael
Konstantin Kolinko wrote:
 2012/3/29 Osipov, Michael michael.osi...@siemens.com:
 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?

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



Re: Chasing a SocketTimeoutException with APR

2012-03-30 Thread Konstantin Kolinko
2012/3/30 Osipov, Michael michael.osi...@siemens.com:
 Konstantin Kolinko wrote:
 2012/3/29 Osipov, Michael michael.osi...@siemens.com:
 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 2.  I do not know what value is in
your server.xml file.


(This 2 vs 6 difference is known and is mentioned in TC7 docs).

Best regards,
Konstantin Kolinko

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



RE: Chasing a SocketTimeoutException with APR

2012-03-30 Thread Osipov, Michael
Konstantin Kolinko wrote:
 2012/3/30 Osipov, Michael michael.osi...@siemens.com:
 Konstantin Kolinko wrote:
 2012/3/29 Osipov, Michael michael.osi...@siemens.com:
 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 2.  I do not know what value is in
 your server.xml file.

My server.xml says 5000 milliseconds for connection timeout. I should increase 
that value and check for a few days.

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