Re: Apache2/Modperl2 fails to preload Win32::OLE at server startup

[prev] [thread] [next] [Date index for 2004/11/26]

From: Thierry Valentin
Subject: Re: Apache2/Modperl2 fails to preload Win32::OLE at server startup
Date: 17:49 on 26 Nov 2004
Hello,
I've tried the My::HappyWorkaround::CLONE trick...
But sorry, same punishment as before:
=> Apache refuses to start + MS Failure Dialog.

Jan Dubois was pointing out that win32::OLE was not thread safe. So this could 
explain why this still fails at startup, whatever the way we try to load this 
module.

I tried Randy Kobes' suggestion: I moved Win2::OLE outside the startup script 
back to my perl scripts and it solves the problem

Thanks again for your help.



Stas Bekman wrote:
> Thierry Valentin wrote:
> [...]
> 
>>> PerlChildInitHandler  'sub { require Win32::OLE}'
>>>
>>
>> Hello
>> I've tried this: the startup still fails
>> but this time I have no MS error dialog saying that Apache had a problem
>> Apache "cleanly" refuses to start.
>> But there are still no lines in the error.log
> 
> 
> As Jan has answered, the problem is that module is not thread-safe, so 
> my original proposal doesn't work. but see below.
> 
>  > This raises another question:
>  > Is there a performance/memory issue regarding preloading a perl 
> module  > at startup vs. loading it in ModPerl::Registry perl scripts ?
> 
> There certainly is. But each perl interpreter will suffer it only the 
> first time it loads this module, all subsequent requests to the same 
> interpreter will not have any additional overhead.
> 
> There is one possible solution that will work for you though. Try to add 
> to startup.pl the following code:
> 
> sub My::HappyWorkaround::CLONE {
>    require Win32::OLE;
> }
> 
> CLONE is a special function which is called when a new interpreter is 
> started. Think of it as ChildInit but for the interpreter.
> 
> Did it do the trick?
> 


        -- 
        

Thierry Valentin
earth decision sciences SA
/(formerly known as T-Surf)/
22, allée de la Foret de la Reine
54500 Vandoeuvre-lès-Nancy, France
Email: valentin@xxxxxxxxxxxxx.xxx
Phone: +33 (0)3-83-67-66-29
Fax: +33 (0)3-83-67-66-34
Please visit our website at: www.earthdecision.com
<http://www.earthdecision.com/>;


-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html

(message missing)

Re: Apache2/Modperl2 fails to preload Win32::OLE at server startup
Thierry Valentin 17:49 on 26 Nov 2004

Generated at 11:26 on 21 Dec 2004 by mariachi v0.52