You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Igor Tatarinov <ta...@prairie.NoDak.edu> on 1997/12/05 20:21:18 UTC

Re: Module init called twice? (full msg: final try :)

Sorry, something is wrong with me today: for the second time I pressed
Enter without releasing Control first and my Netscape obediently sent 
an incomplete message :(

Dean Gaudet wrote:
> 
> On Fri, 5 Dec 1997, Igor Tatarinov wrote:
> 
> > Yet, it's not clear to me why we need main::init_modules() if
> > standalone_main::init_modules() is called right after it.
> 
> Consider also the error log and config time errors... we'd have to buffer
> the errors if we wanted them to appear in the error log and only read
> once.

But this doesn't explain why we need main::init_modules() since 
open_logs is only called in standalone_main() (after read_config()).

So, currently first pass module_init errors are printed on screen while 
second pass module_init() errors go into the error log. This is what
I got when i tried my module first.

OK, I will to make my question clearer. The current execution path is:

main::          read_config
main::          init_modules
standalone::    detach()
standalone::    copy_listeners()
standalone::    kill_cleanups_for_fd
*		clear_pool()
*		make_sub_pool()
*		read_config()
*		setup_listeners()
*		open_logs()
*		init_modules()

So the question is which function between main::init_modules() and
standalone::init_modules() requires the first call to init_modules()
(in main).

After, standalone::clear_pool() it shouldn't make any sence. But there 
is nothing suitable in between.

Thanks,
igor

Re: Module init called twice? (full msg: final try :)

Posted by Dean Gaudet <dg...@arctic.org>.
On Fri, 5 Dec 1997, Igor Tatarinov wrote:

> OK, I will to make my question clearer. The current execution path is:
> 
> main::          read_config
> main::          init_modules
> standalone::    detach()
> standalone::    copy_listeners()
> standalone::    kill_cleanups_for_fd
> *		clear_pool()
> *		make_sub_pool()
> *		read_config()
> *		setup_listeners()
> *		open_logs()
> *		init_modules()
> 
> So the question is which function between main::init_modules() and
> standalone::init_modules() requires the first call to init_modules()
> (in main).

Who knows?  init_modules executes arbitrary code in each module.  Yes it's
kind of unfair that the core module (setup_listeners, open_logs) has
foreknowledge that it doesn't have to initialize the first time. 

mod_perl broke when I changed this. 

It'll look completely different in 2.0, it has to, some of that is
architecture specific.

Dean