axis-c-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Wyckoff <ben.wyck...@mirror-image.com>
Subject Re: [Axis2C] mod_axis2 service shutdown problem
Date Wed, 20 Feb 2008 19:05:05 GMT
Thanks for the response Dumindu. I added the issue to Jira, and I'm moving
the discussion to the dev list because I think the issue is a bit more
complex.

For the record, I'm an experienced developer, and I've spent a considerable
amount of time in the past couple of years working on apache modules. I'm
relatively new to "web services" (but not web servers), but I hope I can
contribute meaningfully to the axis2c project.

There are a couple of related issues I think.

The axis2_post_config handler runs in the root apache process, but if I
understand correctly, services aren't loaded and initialized until they are
first referenced in the context of a child process. If that is the case, the
svc_skeleton_free operation should also happen in the context of the child
process, right? I recall seeing something in the archives about a fix to
prevent services from being loaded multiple times, but I don't know the
details.

Also, when I have worked wth apr_rmm in apache modules in the past, I have
used the child_init hook to call rmm_attach, and then a child pool cleanup
handler to call rmm_detach, according to the rmm docs. From what I've seen,
many modules fail to do that, and I believe it is "safe" because those
functions are a no-op. Furthermore, mod_axis2 doesn't call rmm_destroy.

In my particular scenario, I want to use a Transactional BerkeleyDB,
possibly with replication, which means that bdb needs to run in a single
process. I can control the httpd.conf to only create a single child, but I
need to make sure that my axis2c service that uses bdb is initialized and
freed in the same process so I can properly initialize and close my db.

Since the axis2 worker is created in the root process, it makes sense to
free that in the root process as well. I don't yet understand the inner
workings of the axis2 worker, but it seems to me that mod_axis2 could use
the child_init hook to register a child process pool cleanup handler to
notify the worker that a child is going away, and then the worker could (via
refcounting perhaps) free the appropriate service skeletons? There is still
an issue of handling the multiple-child-process general case - how does the
overall design address that situation?

Regards,
-Ben

> 
> On Feb 20, 2008 1:40 AM, Ben Wyckoff <ben.wyckoff@mirror-image.com> wrote:
> <snip>
>> Has anyone else run into this issue? Is anyone trying to allocate resources
>> that have to be freed? (In particular, I'm opening a database, and I need to
>> properly close it - I can't just rely on the OS to free memory or close file
>> handles.)
> </snip>
> 
> This seems to be a problem with mod_axis2. Although the memory
> allocated with apr_pools will get free'd eventually without free
> functions being called, in order to free up other resources, we need
> to register relevant free functions to pool cleanup of a pool which
> has resource's lifetime. Please add a jira issue.
> 
> The attached patch should solve this issue when shared memory is not
> used. I'm not sure if it works when shared memory is used. Hope that
> someone familiar with axis2c shared memory implementation will look
> further into it.
> 
> Regards,
> Dumindu.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org


Mime
View raw message