Re: Apache::Reload : eval { require $filename }

2001-08-03 Thread Stas Bekman

On Thu, 2 Aug 2001, Sidharth Malhotra wrote:

 In the Apache::Reload module, if the 'require' fails, your script bails out,
 and your client gets status 500.  The side effect is that totally unrelated
 scripts can fail because a bad programmer on another end of the system
 forgot my a variable.

 My proposed solution is to put the require inside an eval.  Upon failure,
 simply write to the error log.

 My Question:  If the require is in an eval, what happens when a reload
 fails?  Does the old code in memory stay or or is it removed w/out being
 replaced by the updated code?

Apache::Reload shouldn't be used on production systems. At least in the
way you describe. This dissolves the problem.

_
Stas Bekman  JAm_pH --   Just Another mod_perl Hacker
http://stason.org/   mod_perl Guide  http://perl.apache.org/guide
mailto:[EMAIL PROTECTED]   http://apachetoday.com http://eXtropia.com/
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/





Re: Apache::Reload : eval { require $filename }

2001-08-02 Thread Henrik Edlund

On Thu, 2 Aug 2001, Sidharth Malhotra wrote:

SM In the Apache::Reload module, if the 'require' fails, your script
SM bails out, and your client gets status 500.  The side effect is
SM that totally unrelated scripts can fail because a bad programmer
SM on another end of the system forgot my a variable.
SM
SM My proposed solution is to put the require inside an eval.  Upon
SM failure, simply write to the error log.

I already handle this in my own code in a system with pluggable user
modules. I want to control myself if the scripts dies (which is does on
system modules) or not (which it does not on user supplied modules).

SM My Question:  If the require is in an eval, what happens when a reload
SM fails?  Does the old code in memory stay or or is it removed w/out being
SM replaced by the updated code?

I do not want Apache::Reload to remove this control from me, and I do not
under any case want old code to remain in memory or be removed, and
execution continue, when I have given a reload command. That would be a
major security risk.

-- 
Henrik Edlund [EMAIL PROTECTED]
http://www.edlund.org/

You're young, you're drunk, you're in bed, you have knives; shit
happens. -- Angelina Jolie