tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Wang" <wangwen...@gmail.com>
Subject Re: question : encounter java.net.SocketTimeoutException: Read timed out occasionally
Date Wed, 05 Nov 2008 15:07:02 GMT
Hi Mark & all,

After using the Jpcap (java sniffer tool) to watch the http packets, We
Finally
found out the root cause of this problem is indeed the keep-live BUG of
Internet
Explorer, below is our finding for your reference :

Finding 1 : When using AJAX to make http requests, Internet Explorer always
sends
            http header and body separately in 2 (or more) IP packets. and
in our
            case the header is always sent in the first packet since the
header
            length is never greater than 1460 bytes(Maximum packet data
size).

Finding 2 :

          1) When apache httpd server detects the keep-live timeout, it will
send
             a Fin (finish) Packet to Client (IE) telling it to close the
connection,
             but at meanwhile Client is preparing to send another POST
request to Apache,
             for unknown reasons (IE BUG!) IE still keeps sending the POST
head & body instead
             of closing connection immediately.

          2) Apache server will ignore the POST request. and send the ACK
Packet back
             to Client.

          3) and next, the Client sends a Fin(Finished) Packet to apache
server to confirm
             closing connection.

          4) Apache server sends an ACK packet to confirm ending this
connection.


          5) Next, Client resend the POST header again to Apache server.

          6) Apache Server confirm receiving the header.

          7) after about 1.5 minutes, Client send a RST (Reset) packet to
Apache
             Server asking reset the connection. In this case the POST body
is
             never sent to Apache server that causes the request parameters
is
             missing.

Following is the Packet flow for your reference : (Time format hhms.S)


   Time              From        to          SEQ         ACK
Flag        remark
   ========  ======   ======  =======  =========  ====
====================================
   071249.751   Client   Apache  1088748537   1807070026           previous
conversion sent from Client
   071304.243   Apache   Client  1807070026  1088748537
FIN     time-out(idle 15 seconds)
   071304.467   Client   Apache  1088748537  1807070026  PSH   Client still
sends POST header
   1807070027   Apache   Client  1807070027  1088749235
   1088749235   Client   Apache  1088749235  1807070026  PSH   Client still
sends POST body
   071304.479   Apache   Client  1807070027  1088749316
   071304.720   Client   Apache  1088749316  1807070027
   071304.721   Client   Apache  1088749316  1807070027  Fin     Finish the
connection
   071304.722   Apache   Client  1807070027  1088749317            Server
confirm ending the connection

   071304.737   Client   Apache  1959299521  1807484246  PSH   Client resend
the Post header in another connection
   071304.737   Apache   Client  1807484246  1959300219            Apache
confirm receiving this header
   071425.235   Client   Apache  1959300219  1807484246  RST   after about
1.5 minutes, Client request to reset the connection
In conclusion, the problem  only happens when Keep-Alive is timeout, that's
why it's related to the apache keep-alive
setting, smaller keep-alive timeout will raise the timeout frequency and
cause more missing body part errors as well.

Unfortunately, so far there is no solution yet unless Microsoft fix the BUG.


Thanks
James.

>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message