Hi,

Problem:
Axis client not closing HTTP "close" response from the AXIS HTTP server, this result with CLOSE WAIT(s) TCP state. As a result of this, eventually the client will throw "too many open files" exception.

Description:

CLOSE WAIT state is an invalid TCP state, basically this state is a result of an application not sending the FIN TCP message for a CLOSE request.

I used tcpdump to trace the AXIS TCP message and I do see that the server, correctly, is responding with close HTTP header, see below:

Server: Apache-Coyote/1.1
Content-Type: text/xml;charset=utf-8
Date: Wed, 14 Sep 2005 02:10:49 GMT
Connection: close

I included the HTTP request (I didn't include the SOAP envelope)

Content-Type: text/xml; charset=utf-8
Accept: application/soap+xml, application/dime, multipart/related, text/*
User-Agent: Axis/1.2.1
Host: test-l1.cnn.com:8080
Cache-Control: no-cache
Pragma: no-cache
SOAPAction: ""
Content-Length: 1456


I download the axis 1.2.1 source code and I looked at HttpSender.java but I can't find the code to handle server close response.

The two close executions are in the following functions:

public void invoke(MessageContext msgContext) throws AxisFault {
            try {

                    if (socketHolder.getSocket() != null ) {

                        socketHolder.getSocket().close();

                    }

            } catch (IOException ie) {

                // we shouldn't get here.

            }


and in function  (this is not used in the client case)

  private InputStream writeToSocket(SocketHolder sockHolder,

            MessageContext msgContext, URL tmpURL,

            StringBuffer otherHeaders, String host, int port, int timeout,

            BooleanHolder useFullURL)

            throws Exception {


       if (!http10) {

            //Force close for now.

            //TODO HTTP/1.1

            httpConnection = HTTPConstants.HEADER_CONNECTION_CLOSE;

        }

}

Environment:
both client and server are running on linux 2.4.21-4.0.1.EL
Java 1.5.0
The server is running tomcat 5.5.11

Did I miss anything ? is this expected ? If we don't want to support keep-alive that's fine but why the client is not closing connection when the server returns HTTP:close header ? I will appreciate any feedback on how to resolve this issue.

Thanks



Reply via email to