You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Jonas Bull <me...@jonasbull.com> on 2010/05/25 16:22:37 UTC

CGI pages not recompiling

Server: Apache/1.3.37 (Unix) mod_perl/1.29

During an active development cycle, with many changes and updates,
perl cgi pages are getting "stuck" in the mod_perl.

The symptom is, for example a syntax error which has been fixed
sporadically reappears, but goes away again on refresh.

When it gets really bad, pages which have been completely replaced by
new code will reappear.

Bouncing the apache server fixes the problem temporarily.

Jonas Bull
601-324-0324 (Office)
228-222-2855 (Home)

Re: CGI pages not recompiling

Posted by Perrin Harkins <pe...@elem.com>.
On Tue, May 25, 2010 at 5:32 PM, Jonas Bull <me...@jonasbull.com> wrote:
> It isn't always variable related...  But I can see where maybe upload
> new version=>refresh page=>get a stale process could be happening.

It shouldn't, since the mtime check on the file happens at the
beginning of handling the request.  You might want to put some warn
statements into Apache::Registry to see if it's noticing your files
have changed.

> In this situation the httpd does not recognize the -X option.

The Solaris version of apache 1.3 doesn't support -X?  I'm surprised.

- Perrin

Re: CGI pages not recompiling

Posted by Jonas Bull <me...@jonasbull.com>.
It isn't always variable related...  But I can see where maybe upload
new version=>refresh page=>get a stale process could be happening.

In this situation the httpd does not recognize the -X option.

I guess we'll have to wait longer.

A server update is in the works, though.

Jonas Bull
601-324-0324 (Office)
228-222-2855 (Home)




On Tue, May 25, 2010 at 3:40 PM, Perrin Harkins <pe...@elem.com> wrote:
> On Tue, May 25, 2010 at 4:01 PM, Jonas Bull <me...@jonasbull.com> wrote:
>>  In the logs, I see notification of the changes to the script
>> - sometimes.  Most of the time, actually.  But occasionally the
>> process fails to catch the changes, which is annoying, but not as
>> troubling as the case where the script seems to recall a previous
>> version AFTER correctly compiling and executing the current version.
>
> Are the changes that seem to be missed things that could result from a
> variable keeping its previous value?  Or are they things like text
> contained in the script itself?  Your comment about scripts seeming to
> use the old version after compiling the new one also sounds like a
> persistent variable problem.
>
> Remember, there are multiple child processes and every one of them
> needs to recompile the script separately when it gets called.
> Sometimes this can get very confusing to debug, so you may want to try
> using the -X flag to run in single-server mode in order to reproduce
> the problem you see in production.
>
> - Perrin
>

Re: CGI pages not recompiling

Posted by Perrin Harkins <pe...@elem.com>.
On Tue, May 25, 2010 at 4:01 PM, Jonas Bull <me...@jonasbull.com> wrote:
>  In the logs, I see notification of the changes to the script
> - sometimes.  Most of the time, actually.  But occasionally the
> process fails to catch the changes, which is annoying, but not as
> troubling as the case where the script seems to recall a previous
> version AFTER correctly compiling and executing the current version.

Are the changes that seem to be missed things that could result from a
variable keeping its previous value?  Or are they things like text
contained in the script itself?  Your comment about scripts seeming to
use the old version after compiling the new one also sounds like a
persistent variable problem.

Remember, there are multiple child processes and every one of them
needs to recompile the script separately when it gets called.
Sometimes this can get very confusing to debug, so you may want to try
using the -X flag to run in single-server mode in order to reproduce
the problem you see in production.

- Perrin

Re: CGI pages not recompiling

Posted by Jonas Bull <me...@jonasbull.com>.
Apologies for the direct reply.  Apparently the list isn't its own reply-to...

#Code_has_been_changed__but_it_seems_the_script_is_running_the_old_code

Describes pretty much what is happening, except the code changes in
question are definitively NOT in modules, which is why I find it
strange.  In the logs, I see notification of the changes to the script
- sometimes.  Most of the time, actually.  But occasionally the
process fails to catch the changes, which is annoying, but not as
troubling as the case where the script seems to recall a previous
version AFTER correctly compiling and executing the current version.


I looked back at my first post, and I neglected to mention that the OS
this is running on is
SunOS xxxxxxxx 5.10 Generic_141414-10 sun4us sparc FJSV,GPUZC-M

To the best of my knowledge this machine shouldn't be doing delayed
writes or anything like that.

Jonas Bull
601-324-0324 (Office)
228-222-2855 (Home)




On Tue, May 25, 2010 at 2:41 PM, Perrin Harkins <pe...@elem.com> wrote:
> [ please keep it on the mailing list ]
>
> On Tue, May 25, 2010 at 2:25 PM, Jonas Bull <me...@jonasbull.com> wrote:
>> httpd.conf has the following:
>>        SetHandler              perl-script
>>        PerlSendHeader       On
>>        PerlHandler             Apache::Registry
>>        Options                 ExecCGI
>
> Okay, so you're running through Apache::Registry.  That should notice
> when you update a .cgi (or .pl or whatever you've used) file and
> reload.  If you have any code in modules, those will need to be
> reloaded in a different way, possible with Apache::Reload.  More
> likely though, you're just seeing persistent variables where you
> didn't expect them.  Here's some information on what's happening:
> http://perl.apache.org/docs/1.0/guide/porting.html
>
> If you can give us a specific example of the behavior you're seeing
> and show us some of the code, we can help you identify the problem.
>
> - Perrin
>

Re: CGI pages not recompiling

Posted by Perrin Harkins <pe...@elem.com>.
[ please keep it on the mailing list ]

On Tue, May 25, 2010 at 2:25 PM, Jonas Bull <me...@jonasbull.com> wrote:
> httpd.conf has the following:
>        SetHandler              perl-script
>        PerlSendHeader       On
>        PerlHandler             Apache::Registry
>        Options                 ExecCGI

Okay, so you're running through Apache::Registry.  That should notice
when you update a .cgi (or .pl or whatever you've used) file and
reload.  If you have any code in modules, those will need to be
reloaded in a different way, possible with Apache::Reload.  More
likely though, you're just seeing persistent variables where you
didn't expect them.  Here's some information on what's happening:
http://perl.apache.org/docs/1.0/guide/porting.html

If you can give us a specific example of the behavior you're seeing
and show us some of the code, we can help you identify the problem.

- Perrin

Re: CGI pages not recompiling

Posted by Perrin Harkins <pe...@elem.com>.
On Tue, May 25, 2010 at 10:22 AM, Jonas Bull <me...@jonasbull.com> wrote:
> During an active development cycle, with many changes and updates,
> perl cgi pages are getting "stuck" in the mod_perl.

How are you running this code?  Is it through ModPerl::Registry?  Are
there modules involved?

- Perrin