apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From NormW <no...@gknw.net>
Subject Re: apr, pools and NetWare
Date Thu, 28 Jul 2011 07:49:23 GMT
On 28/07/2011 1:39 PM, Nick Kew wrote:
> On 28 Jul 2011, at 02:24, NormW wrote:
>> Hi,
>> Raised this some months ago but response was left than deafening, and
>> advice says 'have another go', so...
> Netware being a minority platform, few are qualified to comment.

>> In apr\memory\unix\apr_pools.c:
>>> APR_DECLARE(apr_pool_t *) apr_pool_parent_get(apr_pool_t *pool)
>>> {
>>> #ifdef NETWARE
>>>    /* On NetWare, don't return the global_pool, return the application pool
>>>       as the top most pool */
>>>    if (pool->parent == global_pool)
>>>        return pool;
>>>    else
>>> #endif
>>>    return pool->parent;
>>> }
> Can you throw any light on the reason for that?  I wonder if the semantics
> of "parent pool" are messed up?
The NETWARE block in apr_pool_parent_get() was added by Brad Nicholes in
r411301 back in June 2006; the for() loop was added in r659294 in May
2008. The dbd databases are not a heavily tested part of httpd on
NetWare and it only became evident once we started trying to use MySQL
as an auth SQL database. When trying to load the mysql driver the server
would hang until the CPU spat the dummy (cooperative tasking) on the thread.
>> in apr\dbd\apr_dbd.c:
>>>    for (parent = pool;  parent; parent = apr_pool_parent_get(pool))
>>>         pool = parent;
>> Cannot see how NetWare can escape this loop if apr_pool_parent_get()
>> returns the same pool passed in to the function.
> Indeedie!

>> Either (in NetWare case):
>> - apr_pool_parent_get() has to return something other than the same
>> 'pool' to allow the loop to exit, OR
>> - the loop needs to determine if it got the same pool back (at least in
>> NetWare case) and exit the loop.
>> Comments please.
> My first thought was a variant on that: turn the "parent [!= NULL]" test
> into a macro that resolves to something different on Netware.
> But  I wouldn't try without at least a basic insight into those pool semantics.
> Did you offer a patch?
Yes. The NETWARE block inside apr_pool_parent_get() I would treat as a
'given' as Brad is a software engineer at Novell, so the only point of
tweaking (without Brad's input) was in the loop where the function is
used. The patch (as submitted) was tested on my NetWare box and solved
the hang problem described.


View raw message