You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@perl.apache.org by Javier Uruen Val <ju...@warp.es> on 2006/01/13 15:22:25 UTC
right patch for Apache::Reload
Hi,
Yesterday I sent an email attaching a patch for what i thought it could be a
bug in Apache::Reload. I attached the wrong patch, so here it is the proper
one.
Previous mail:
-----------------
First of all thank you very much for maintaining Apache::Reload. We want to
use it in our project [0] to avoid restarting apache when upgrading our
modules running under mod_perl. Everything works ok and gets reloaded
properly when modifying files except for the following case:
- Module A uses symbols exported by Module B
- Module A is located before than B in %INC when iterating.
- Module A and B have changed and A uses new symbols exported by B
When that happens we got an error when Apache::Reload tries to
recompile A having the old B symbols still in memory and it can't found the
new symbol.
I don't know if this is the expected behavior and I misunderstood
everything or maybe I'm using the wrong module and it's totally deprecated.
Anyway, I've written a small patch to workaround this problem.
Basically, it removes all the modified modules before reloading them. Instead
of doing a remove/reload per module.
The patch is attached.
Thank you very much again for your work and your time.
--
Javier Uruen Val - Systems Developer
Warp Networks, S.L - Mobile: 685 876 026
Re: right patch for Apache::Reload
Posted by Javier Uruen Val <ju...@warp.es>.
Hi,
[...]
> > - Module A uses symbols exported by Module B
> > - Module A is located before than B in %INC when iterating.
> > - Module A and B have changed and A uses new symbols exported by
> > B
> >
> > When that happens we got an error when Apache::Reload tries to
> > recompile A having the old B symbols still in memory and it can't found
> > the new symbol.
> >
> > I don't know if this is the expected behavior and I misunderstood
> > everything or maybe I'm using the wrong module and it's totally
> > deprecated.
>
> This is actually a nice bug in Apache::Reload, thanks for the investigative
> work.
Ok. Thanks for the confirmation.
[...]
> I guess you are using mod_perl 1.x and not 2.x. I've committed r370007 that
> implements your change in the mod_perl-2.x codebase, since that's where
> most of the active development happens.
Yes, we are using mod_perl 1.x for our project [0].
> If/When there comes a time for another mod_perl-1.x release, I'll probably
> take the time to apply a similar patch to Apache::Reload.
Great. At the moment, we are using the last stable debian package patched with
the sent patch.
[0] http://www.ebox-platform.com
--
Javier Uruen Val - Warp Networks, S.L
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org
Re: right patch for Apache::Reload
Posted by "Philippe M. Chiasson" <go...@ectoplasm.org>.
Javier Uruen Val wrote:
> Hi,
>
> Yesterday I sent an email attaching a patch for what i thought it could be a
> bug in Apache::Reload. I attached the wrong patch, so here it is the proper
> one.
>
> Previous mail:
> -----------------
> First of all thank you very much for maintaining Apache::Reload. We want to
> use it in our project [0] to avoid restarting apache when upgrading our
> modules running under mod_perl. Everything works ok and gets reloaded
> properly when modifying files except for the following case:
>
> - Module A uses symbols exported by Module B
> - Module A is located before than B in %INC when iterating.
> - Module A and B have changed and A uses new symbols exported by B
>
> When that happens we got an error when Apache::Reload tries to
> recompile A having the old B symbols still in memory and it can't found the
> new symbol.
>
> I don't know if this is the expected behavior and I misunderstood
> everything or maybe I'm using the wrong module and it's totally deprecated.
This is actually a nice bug in Apache::Reload, thanks for the investigative work.
Your patch is conceptually correct. Apache:Reload should first unload all modified
modules, _then_ attempt to reload them all. That way, module dependencies would
be correctly satisfied and the problem you are having would dissapear.
> Anyway, I've written a small patch to workaround this problem.
> Basically, it removes all the modified modules before reloading them. Instead
> of doing a remove/reload per module.
>
> The patch is attached.
I guess you are using mod_perl 1.x and not 2.x. I've committed r370007 that
implements your change in the mod_perl-2.x codebase, since that's where most of
the active development happens.
If/When there comes a time for another mod_perl-1.x release, I'll probably take
the time to apply a similar patch to Apache::Reload.
--------------------------------------------------------------------------------
Philippe M. Chiasson m/gozer\@(apache|cpan|ectoplasm)\.org/ GPG KeyID : 88C3A5A5
http://gozer.ectoplasm.org/ F9BF E0C2 480E 7680 1AE5 3631 CB32 A107 88C3A5A5