httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <>
Subject Re: Apache calls initialize module twice
Date Thu, 13 Nov 2003 19:58:27 GMT
Jeff Trawick wrote:
>>   Since the work arounds (such as Bill suggested) are required for 1.3 
>> and 2.0
>> compatiblity already, it seems we should focus on 2.1 and solve this 
>> for good.
> as far putting a solution in 2.0, what is it our concern if a module 
> wants to support only Apache >= 2.0.50?  we may have our own modules 
> that need such an API enhancement

Yup, mod_perl 2.0 now requires 2.0.46 and will most likely shift that 
requirement up with time. We can make this an optional feature, available only 
when Apache has it.

>>   We have a new facility, ap_mpm_query, which would be perfect for 
>> answering
>> nuggets of wisdom such as;
>>   * Running as a win32 service?  Or detached console daemon?
>>   * A parent process?  (Pre-fork or never forking (e.g. win32?)
>>   * Pre-startup config testing?
>>   * Server generation?  (This answers the 2nd, 3rd, 4th startup pass 
>> question)
> a check for is-terminating would be nice too...  there's a nice mod_cgid 
> restart patch in 2.1-dev that needs a way to query whether the other 
> child checker got APR_OC_REASON_DEATH because the other child died on 
> its own or because it died because the server is terminating...  right 
> now the logic uses ap_graceful_stop_signalled(), which is a dummy 
> function with prefork... with worker, ap_graceful_stop_signalled() works 
> well enough for the mod_cgid patch, but it doesn't distiguish between 
> graceful and ungraceful termination
> If we add AP_MPMQ_QUERY_STATE request that returns one of 
> be able to get some type of clue on the big picture, though that doesn't 
> help with which pass of the pre/post-config hook it is.
> ap_mpm_query(), implemented by each MPM, would need some help from core 
> to determine which pass of the pre/post-config hook it is, since that is 
> out of the MPM's domain.
> I must admit I don't understand the original initialize-module question 
> and how it relates to whether MPM is run with -X mode.  Any clues?  I 
> can see plain as day the pre-config/post-config issue in 
> server/main.c:main().  Without that understanding, I'm not sure what 
> sort of info sharing is needed between core and the MPM to allow module 
> to know whether or not this is the last time a certain hook will be 
> called during [re-]initialization.

There are two seemingly unrelated (ortogonal?) questions:

1. Are we parsing config for the first or the second time

2. Are we in one of the START|RESTART|GRACEFUL|STOP mode.

Only in the START mode a module needs to know whether its config hooks are run 
for the first time or the second. In the rest of the modes it's always run 
once (first time).

So depending on how you look it, the two can be related or not.

I think there should be two unrelated functions. One telling us whether we are 
in first/second time config parsing (and I've posted a core patch for this). 
The other telling us the operation mode (requires patching of all mpm 

Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker     mod_perl Guide --->

View raw message