Question on clearing mason cache

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Am I misunderstanding something, or is it the case that, if RT is running
with mod_perl, the mason cache is automatically cleared on each apache
restart, assuming I’m not running with ‘DevelMode’ on? That’s what the
code in webmux.pl seems to be doing.

Over the years, I’ve seen many comments reminding someone to clear the
mason cache in addition to restarting RT, when making certain kinds of
changes. But now I’m wondering about this, at least in a mod_perl
environment.

I’m referring specifically to this code in webmux.pl:

if ($ENV{'MOD_PERL'} && !$RT::DevelMode) {
    # Under static_source, we need to purge the component cache
    # each time we restart, so newer components may be reloaded.
    # We can't do this in FastCGI or we'll blow away the component root
    # _every_ time a new server starts which happens every few hits.

    use File::Path qw( rmtree );
    use File::Glob qw( bsd_glob );
    my @files = bsd_glob("$RT::MasonDataDir/obj/*");
    rmtree([ @files ], 0, 1) if @files;
}

Can I assume that restarting apache will, in fact, cause the mason cache
to be cleared every time? I am running with mod_perl and do have a
‘PerlRequire’ statement that runs webmux.pl.

When I look at the timestamps on the members of var/mason_data/obj,
they’re always mostly very current, even if RT hasn’t been started in
quite a while. And I do have $DevelMode set to ‘0’ in RT_SiteConfig.pm.
But this doesn’t mean too much, since presumably things are being
cached all the time. That’s why I’m asking the question here.

This is RT 3.6.3, but webmux.pl looks similar in earlier versions I’m
running as well.

Thanks for clarifying all this.

Mike

Mike Friedman Information Services & Technology
mikef@ack.Berkeley.EDU 2484 Shattuck Avenue
1-510-642-1410 University of California at Berkeley
Socrates and Berkeley Scholars Web Hosting Services Have Been Retired | Web Platform Services http://ist.berkeley.edu

-----BEGIN PGP SIGNATURE-----
Version: PGP 6.5.8

iQA/AwUBRkOfca0bf1iNr4mCEQLZ1gCdHM7BvLu5uLJFOGkobvSnssy50Z4AoMqj
ZCzbqsc0DmB0tuQpsYNO67hJ
=pPMF
-----END PGP SIGNATURE-----

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Am I misunderstanding something, or is it the case that, if RT is
running with mod_perl, the mason cache is automatically cleared on
each apache restart, assuming I’m not running with ‘DevelMode’ on?
That’s what the code in webmux.pl seems to be doing.

Over the years, I’ve seen many comments reminding someone to clear
the mason cache in addition to restarting RT, when making certain
kinds of changes. But now I’m wondering about this, at least in a
mod_perl environment.

In a mod_perl environemnt, this should be taken care of
automatically. In a FastCGI environment, we can’t do it this way or
each new fastcgi that started would blow away the cache…right out
from under the other processes.

PGP.sig (186 Bytes)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1On Fri, 11 May 2007 at 11:28 (-0400), Jesse Vincent wrote:

Am I misunderstanding something, or is it the case that, if RT is
running with mod_perl, the mason cache is automatically cleared on each
apache restart, assuming I’m not running with ‘DevelMode’ on? That’s
what the code in webmux.pl seems to be doing.

Over the years, I’ve seen many comments reminding someone to clear the
mason cache in addition to restarting RT, when making certain kinds of
changes. But now I’m wondering about this, at least in a mod_perl
environment.

In a mod_perl environment, this should be taken care of automatically.
In a FastCGI environment, we can’t do it this way or each new fastcgi
that started would blow away the cache…right out from under the other
processes.

Jesse,

Thanks for confirming this. It’s good to know I shouldn’t ever have to
clear the cache manually (where I’m using mod_perl).

I guess a lot of folks run with FastCGI, judging from the comments (here
and in various places in the wiki) about manually clearing the cache.
I’ve never seen such a comment qualified by “unless you’re using
mod_perl”).

Mike

Mike Friedman Information Services & Technology
mikef@ack.Berkeley.EDU 2484 Shattuck Avenue
1-510-642-1410 University of California at Berkeley
Socrates and Berkeley Scholars Web Hosting Services Have Been Retired | Web Platform Services http://ist.berkeley.edu

-----BEGIN PGP SIGNATURE-----
Version: PGP 6.5.8

iQA/AwUBRkVJwa0bf1iNr4mCEQJMtwCeIfygQejT4WyPBrPrN2Dje/mhQI4Anitd
7iPr1OcGeoTuAAX/OC4s4wjm
=CbVa
-----END PGP SIGNATURE-----