It seems that the following solves CLOSE_WAIT problem for me. I
didn't checked if it breaks anything else, especially if you use
HTTP 1.1 with keep-alives for SSL.

--- axis2c.orig/src/core/transport/http/sender/ssl/ssl_stream.c 2012-09-05 
05:01:12.000000000 +0200
+++ axis2c/src/core/transport/http/sender/ssl/ssl_stream.c      2012-10-05 
21:55:22.616002899 +0200
@@ -121,6 +121,8 @@
     axutil_stream_t* stream = (axutil_stream_t*)streamv;
     stream_impl = AXIS2_INTF_TO_IMPL(stream);
     axis2_ssl_utils_cleanup_ssl(env, stream_impl->ctx, stream_impl->ssl);
+    if(stream_impl->socket > -1)
+      axutil_network_handler_close_socket(env, stream_impl->socket);
     AXIS2_FREE(env->allocator, stream_impl);
 
     return;


On Sat, Sep 29, 2012 at 12:05:08PM +0200, Piotr Isajew wrote:

> Hello,
> 
> I'm encountering several problems with long running client
> programs using http client. In each of those programs stub code
> is generated via WSDL2C.
> 
> With default settings (HTTP/1.1, Keep-Alive) if there is a long
> (say: 30 minutes or so) delay between web service invocations,
> subsequent requests fail with immediate timeout:
> 
> [Sat Sep 29 11:50:27 2012] [error] engine.c(171) Transport sender
> invoke failed
> [Sat Sep 29 11:50:28 2012] [debug] op_client.c(888) 
> Start:axis2_op_client_infer_transport
> [Sat Sep 29 11:50:28 2012] [debug] op_client.c(949) 
> End:axis2_op_client_infer_transport
> [Sat Sep 29 11:50:28 2012] [debug] phase.c(202) Invoke the handler 
> AddressingOutHandler within the phase MessageOut
> [Sat Sep 29 11:50:28 2012] [info]  Starting addressing out handler
> [Sat Sep 29 11:50:28 2012] [debug] addr_out_handler.c(137) No action present. 
> Stop processing addressing
> [Sat Sep 29 11:50:28 2012] [debug] http_transport_sender.c(241) 
> ctx_epr:https://api1.multiinfo.plus.pl/smsgw50.asmx
> [Sat Sep 29 11:50:28 2012] [debug] http_transport_sender.c(776) using axis2 
> native http sender.
> [Sat Sep 29 11:50:28 2012] [debug] http_sender.c(514) 
> msg_ctx_id:urn:uuid:197f41e0-0a1b-1e21-36bd-1c7ee510c2d1
> [Sat Sep 29 11:50:28 2012] [debug] http_transport_utils.c(3835) No session 
> map stored
> [Sat Sep 29 11:50:28 2012] [debug] http_sender.c(907)
> <soapenv:Envelope 
> xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope";><!-- top 
> secret--></soapenv:Envelope>
> [Sat Sep 29 11:50:28 2012] [debug] http_client.c(596) http client , response 
> timed out
> [Sat Sep 29 11:50:28 2012] [error] http_client.c(597) Response timed out
> [Sat Sep 29 11:50:28 2012] [error] http_sender.c(1326) status_code < 0
> [Sat Sep 29 11:50:28 2012] [error] engine.c(171) Transport sender invoke 
> failed
> 
> I managed to solve the problem for one of the clients, which use
> HTTP for communication, by setting it to HTTP/1.0 and turning off
> keep-alives, like that:
> 
> <parameter name="PROTOCOL" locked="false">HTTP/1.0</parameter>
> <parameter name="Keep-Alive" locked="false">true</parameter>
>   
> in transport configuration.
> 
> The above however doesn't work for other program which uses SSL
> with authentication by client certificates. In that case I don't
> get timeouts, but instead sockets persist in CLOSE_WAIT state,
> which eventually leads to using all available file descriptors,
> and then:
> 
> 
> [Sat Sep 29 09:05:00 2012] [error] http_client.c(256) Error
> creating a socket. Most probably error returned by OS
> [Sat Sep 29 09:05:00 2012] [error] http_client.c(257) Socket Creation failed.
> [Sat Sep 29 09:05:00 2012] [error] http_client.c(572) Client data stream null 
> or socket error for host api1.multiinfo.plus.pl and 443 port
> [Sat Sep 29 09:05:00 2012] [error] http_client.c(574) A read attempt(HTTP) 
> for the reply without sending the request
> [Sat Sep 29 09:05:00 2012] [error] http_sender.c(1326) status_code < 0
> [Sat Sep 29 09:05:00 2012] [error] engine.c(171) Transport sender invoke 
> failed
> 
> 
> Development environment is Linux and tests were done with several
> axis versions including 1.7.0-RC6.
> 
> I will appreciate any advice on where to look for solution.
> 
> Regards,
> 
> Piotr
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: c-user-unsubscr...@axis.apache.org
> For additional commands, e-mail: c-user-h...@axis.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: c-user-unsubscr...@axis.apache.org
For additional commands, e-mail: c-user-h...@axis.apache.org

Reply via email to