httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mladen Turk <mt...@apache.org>
Subject Re: svn commit: r741947 - in /httpd/httpd/trunk/modules/mappers: config9.m4 mod_watchdog.c mod_watchdog.h
Date Mon, 09 Feb 2009 07:00:15 GMT
Ruediger Pluem wrote:
> 
>> +        }
>> +        if (w->is_running && w->callbacks == NULL) {
>> +            /* This is hook mode watchdog
>> +             * running on WatchogInterval
>> +             */
>> +            w->step += (apr_time_now() - curr);
>> +            if (w->step >= wd_interval) {
>> +                if (!ctx)
>> +                    apr_pool_create(&ctx, w->pool);
> 
> Is this check really needed? ctx should be always NULL here.
> 

Yes, it's NULL, but only for the first callback.
If there are multiple callbacks they will all use
the same pool for this call.
Also, pool gets created only if one of the callbacks
actually times out.

>> +
>> +    /* This mutex fixes problems with a fast start/fast end, where the pool
>> +     * cleanup was being invoked before the thread completely spawned.
>> +     */
> 
> Can you elaborate this a bit more (maybe with an example)?
> I currently do not understand which problem is solved here.
>

Well, I reused the mod_heartbeat code here, and I think it's
very useful to ensure the thread actually gets created and
running before we allow to kill the child.

>> +    apr_thread_mutex_lock(w->startup);
>> +
>> +    /* Start the newly created watchdog */
>> +    rc = apr_thread_create(&w->thread, NULL, wd_worker, w, p);
>> +    if (rc) {
>> +        apr_pool_cleanup_kill(p, w, wd_worker_cleanup);
> 
> I don't see that this cleanup gets registered anywhere.
>

That got slipped during copy/paste from my dev branch.
Fixed, thanks.


Regards
-- 
^(TM)

Mime
View raw message