Apache::Asp caches subroutine compiles within processes.

Kill all running apache processes to delete their cache.  (you don't
strictly have to restart to do this (killing workers and letting apache
restart them works too) but its easier)

It works when it hits one that loaded the module version that has the
method.

It doesn't work when it hits one that loaded the module version that doesn't
have the method.

I restart apache obsessively when modifying and testing modules for exactly
this reason.

You can also ameliorate this problem by lowering the number of requests a
process handles before restarting, at the expense of cache hits.

Skylos


On Mon, Nov 10, 2008 at 5:01 PM, Roberto C. Sánchez <[EMAIL PROTECTED]>wrote:

> MP gurus,
>
> I recently deployed a site using Apache::ASP.  I am running up against
> a problem that has left me scratching my head.  The site works fine on
> the development server.  However, on the production server, my error_log
> fills with these messages:
>
> [Mon Nov 10 19:44:59 2008] [error] [asp] [7796] [error] Undefined
> subroutine
> &Apache::ASP::Compiles::__ASP__srv_http_www_e_ample_com__x::get_image_data
> called at /srv/http/www.example.com/templates/masthead.tmpl line 2. <--> ,
> /usr/share/perl5/Apache/ASP.pm line 1521
>
> (I have attached the complete error log output, with debugging enabled,
> for a failed request to this email.)
>
> The odd thing is that it is apparently intermittent.  Sometimes, the
> error happens and a 500 error page is returned.  Other times, the page
> loads as expected.
>
> Both servers (development and production) are running Debian Etch with
> Apache 2.2.3, mod_perl 2.0.2, and Apache::ASP 2.59 (all stock versions
> shipped with Debian Etch).
>
> The code that is generating the error is this:
>
> <%
> my %img_data = get_image_data('masthead.png');
> %>
>
> My DocumentRoot is /srv/http/www.example.com and I have a directory
> called /srv/http/www.example.com/Example which has my Perl modules in
> it.  One of the modules is called Image.pm and it has a function called
> get_image_data().  In my global.asa I have "use Example::Image;".
>
> Something that also does not make sense to me is that if I change the
> document root to something like /srv/http/example or /srv/http/site,
> then the error appears to never happen.  I have tested this by using
> both alternate document roots for about two weeks each and it appears to
> not have a problem in either case.
>
> There are two very strange things about this whole situation.  On the
> (nearly) identically configured development server, I never get the
> above error.  I have another site (one that is actually in production,
> as opposed to the example site) that uses a similar scheme on the same
> production server and it does not have this problem.
>
> Regards,
>
> -Roberto
>
> --
> Roberto C. Sánchez
> http://people.connexer.com/~roberto<http://people.connexer.com/%7Eroberto>
> http://www.connexer.com
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.6 (GNU/Linux)
>
> iD8DBQFJGNlw5SXWIKfIlGQRAp2tAJ4hc3UfDt0LszN/6UTrRSErMtmnhACgv2j8
> s4zfI5IlVrRykSFjU2X3gi0=
> =O++Q
> -----END PGP SIGNATURE-----
>
>

Reply via email to