axis-c-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nabeel Yoosuf" <>
Subject Re: file descriptor leak in axis2c client api
Date Fri, 17 Nov 2006 22:22:48 GMT
The free function and client object are set into a property object which is
added to the message context.

//setting the property (inside http_sender)
    property = axis2_property_create(env);
    AXIS2_PROPERTY_SET_FREE_FUNC(property, env,
            axis2_http_client_free_void_arg); -> which inturn calls
    AXIS2_PROPERTY_SET_VALUE(property, env, sender_impl->client);
            property, AXIS2_FALSE);

//after request is served this property get freed

103         if (property_impl->value)
105             if (property_impl->scope != AXIS2_SCOPE_APPLICATION)
107                 if (property_impl->free_func)
109                     property_impl->free_func(property_impl->value, env);
115                 property_impl->value = NULL;

I suspect that it's an issue with closing the client socket in solaris.
AFAIK, the current implementation is not tested on Solaris systems.


On 11/17/06, Beauchamp, Matthew <> wrote:
>   In using the client API I'm seeing leaked file descriptors due to not
> calling close on the sockets after their connections are finished.  To
> illustrate where I'm seeing this I'll describe my application.  My service
> has a "publish" operation (in-out MEP) that clients send commands to.  The
> response they get back is a status indicating the command was received
> successfully.  My service also creates a new thread when it is first
> constructed that reads command responses off of a queue and uses the axis2c
> client api to "publish" these responses back to clients.  Everytime it takes
> a response from the queue the thread allocates, sets options, does a
> SEND_RECEIVE, FINALIZE_INVOKE, and frees the svc_client.  After about 250
> messages I get an "I/O Error: too many open files" from the system, and
> checking the process's file descriptors shows many TCP sockets in a
> CLOSE_WAIT state.  By the way, I forgot to mention that I'm running on
> solaris 8, which may of course be the problem.  I'm wondering though if the
> same thing happens under these conditions when running on Linux.  In looking
> through the code I see that the http_client is added to the msg_ctx in the
> soap_over_http_sender, and there is a comment in the code saying it will be
> free'd elsewhere.  However, I am unable to locate where the http_client is
> actually free'd, and print statements I placed in the axis2_http_client_free
> function never show up in my runs.  Any help anyone could provide would be
> much appreciated.
> Thanks,
> Matt

View raw message