graceful restarts, modperl and pre-loaded modules

Hi,

I was wondering how graceful restarts of apache interact with modperl
and "pre-loaded" modules.

Specifically, if the apache parent process loads module Foo.pm, and I
modify Foo.pm, can I use a graceful restart to get the apache parent
to read the new version of Foo.pm?

Thanks,
ER
E R [ Di, 14 Juli 2009 20:04 ] [ ID #2008488 ]

Re: graceful restarts, modperl and pre-loaded modules

This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enigF34765F3F9ABC388477B12D7
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On 14/07/09 14:04 , E R wrote:
> Hi,
>
> I was wondering how graceful restarts of apache interact with modperl
> and "pre-loaded" modules.
>
> Specifically, if the apache parent process loads module Foo.pm, and I
> modify Foo.pm, can I use a graceful restart to get the apache parent
> to read the new version of Foo.pm?

Yes, it should work that way.

On a gracefull restart, all perl interpreters are shutdown and new,
clean ones replace them, reloading any module you configure for preloadin=
g.

--
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/ m/gozer\ [at] (apache|cpan|ectoplasm)\.org/


--------------enigF34765F3F9ABC388477B12D7
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iD8DBQFKXNA8yzKhB4jDpaURAjqFAJwNmwwodanyCSlsqkAZfrpmrgGStgCf aUaO
hGWqCL6WI6CfB4ZCQlOEH2k=
=hlSR
-----END PGP SIGNATURE-----

--------------enigF34765F3F9ABC388477B12D7--
gozer [ Di, 14 Juli 2009 20:36 ] [ ID #2008489 ]

Re: graceful restarts, modperl and pre-loaded modules

On Tue, Jul 14, 2009 at 2:36 PM, Philippe M.
Chiasson<gozer [at] ectoplasm.org> wrote:
> On a gracefull restart, all perl interpreters are shutdown and new,
> clean ones replace them, reloading any module you configure for preloading.

I don't think this is right, Philippe, unless something has changed
with it in mod_perl 2. Graceful restart used to just re-read the
conf, not restart the perl interpreter.

- Perrin
Perrin Harkins [ Di, 14 Juli 2009 21:00 ] [ ID #2008490 ]

Re: graceful restarts, modperl and pre-loaded modules

This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enig8A8280B383CF1D8EDA0CA0D2
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On 14/07/09 15:00 , Perrin Harkins wrote:
> On Tue, Jul 14, 2009 at 2:36 PM, Philippe M.
> Chiasson<gozer [at] ectoplasm.org> wrote:
>> On a gracefull restart, all perl interpreters are shutdown and new,
>> clean ones replace them, reloading any module you configure for preloa=
ding.
>
> I don't think this is right, Philippe, unless something has changed
> with it in mod_perl 2.

Yup, this has certainly been fixed up in mod_perl 2.

> Graceful restart used to just re-read the
> conf, not restart the perl interpreter.

Now I believe it does, and it's easy to verify.

A loaded PerlModule will get reloaded on graceful restart, that's for sur=
e.

--
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/ m/gozer\ [at] (apache|cpan|ectoplasm)\.org/


--------------enig8A8280B383CF1D8EDA0CA0D2
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iD8DBQFKXNu3yzKhB4jDpaURAhqHAJ9mjBH4uhTO9gIDQjPZCsdp+YleEgCg ldGg
xKOYZgIqoSADnXeewXPpHm4=
=mZj8
-----END PGP SIGNATURE-----

--------------enig8A8280B383CF1D8EDA0CA0D2--
gozer [ Di, 14 Juli 2009 21:25 ] [ ID #2008491 ]

Re: graceful restarts, modperl and pre-loaded modules

On Tue, Jul 14, 2009 at 3:25 PM, Philippe M.
Chiasson<gozer [at] ectoplasm.org> wrote:
>> Graceful restart used to just re-read the
>> conf, not restart the perl interpreter.
>
> Now I believe it does, and it's easy to verify.
>
> A loaded PerlModule will get reloaded on graceful restart, that's for sure.

That won't be enough in all cases unless it actually replaces the
interpreter, like PerlFreshRestart used to.

I would do a graceful shutdown and restart.

- Perrin
Perrin Harkins [ Di, 14 Juli 2009 22:18 ] [ ID #2008493 ]

Re: graceful restarts, modperl and pre-loaded modules

> That won't be enough in all cases unless it actually replaces the
> interpreter, like PerlFreshRestart used to.
>
> I would do a graceful shutdown and restart.

I've had lots of problems with graceful restarts hanging indefinitely, I
think caused by issues with the mod_ssl module.

I'd also recommend: apachectl graceful-stop; apachectl start

clint
Clinton Gormley [ Mi, 15 Juli 2009 11:42 ] [ ID #2008663 ]
Webserver » gmane.comp.apache.mod-perl » graceful restarts, modperl and pre-loaded modules

Vorheriges Thema: is there a TELL method for mod_perl's STDOUT and STDERR
Nächstes Thema: trying to add header field using PerlInputFilterHandler to proxy packets