CGI pages not recompiling

CGI pages not recompiling

am 25.05.2010 16:22:37 von Jonas Bull

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

am 25.05.2010 17:10:52 von Perrin Harkins

On Tue, May 25, 2010 at 10:22 AM, Jonas Bull 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

Re: CGI pages not recompiling

am 25.05.2010 21:41:02 von Perrin Harkins

[ please keep it on the mailing list ]

On Tue, May 25, 2010 at 2:25 PM, Jonas Bull wrote:
> httpd.conf has the following:
> =A0 =A0 =A0 =A0SetHandler =A0 =A0 =A0 =A0 =A0 =A0 =A0perl-script
> =A0 =A0 =A0 =A0PerlSendHeader =A0 =A0 =A0 On
> =A0 =A0 =A0 =A0PerlHandler =A0 =A0 =A0 =A0 =A0 =A0 Apache::Registry
> =A0 =A0 =A0 =A0Options =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 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

am 25.05.2010 22:01:55 von Jonas Bull

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_t he_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 wrote:
> [ please keep it on the mailing list ]
>
> On Tue, May 25, 2010 at 2:25 PM, Jonas Bull wrote:
>> httpd.conf has the following:
>> =A0 =A0 =A0 =A0SetHandler =A0 =A0 =A0 =A0 =A0 =A0 =A0perl-script
>> =A0 =A0 =A0 =A0PerlSendHeader =A0 =A0 =A0 On
>> =A0 =A0 =A0 =A0PerlHandler =A0 =A0 =A0 =A0 =A0 =A0 Apache::Registry
>> =A0 =A0 =A0 =A0Options =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ExecCGI
>
> Okay, so you're running through Apache::Registry. =A0That should notice
> when you update a .cgi (or .pl or whatever you've used) file and
> reload. =A0If you have any code in modules, those will need to be
> reloaded in a different way, possible with Apache::Reload. =A0More
> likely though, you're just seeing persistent variables where you
> didn't expect them. =A0Here'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

am 25.05.2010 22:40:42 von Perrin Harkins

On Tue, May 25, 2010 at 4:01 PM, Jonas Bull wrote:
> =A0In the logs, I see notification of the changes to the script
> - sometimes. =A0Most of the time, actually. =A0But 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

am 25.05.2010 23:32:47 von Jonas Bull

It isn't always variable related... But I can see where maybe upload
new version=3D>refresh page=3D>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 wrote:
> On Tue, May 25, 2010 at 4:01 PM, Jonas Bull wrote:
>> =A0In the logs, I see notification of the changes to the script
>> - sometimes. =A0Most of the time, actually. =A0But 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? =A0Or are they things like text
> contained in the script itself? =A0Your 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

am 26.05.2010 20:56:11 von Perrin Harkins

On Tue, May 25, 2010 at 5:32 PM, Jonas Bull wrote:
> It isn't always variable related... =A0But I can see where maybe upload
> new version=3D>refresh page=3D>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