[mod_python] force a reload?

Jim Gallacher jpg at jgassociates.ca
Wed May 24 22:10:00 EDT 2006


David Bear wrote:
> As I make changes to my publisher script, I think I'm running into
> instances where when I run a test, the 'old' version of the script is
> still be run by apache. Two cases of come up so far.
> 
> 1) I modify code in a psp template to form a new img src path. Some
> times it works -- sometimes not. (when viewing the html source sent to
> the browser its clear the the modified verions of my function is not
> being executed) (note that the code lives in a psp served by a
> publisher script)
> 
> 2) Second instance is where I've modified a function in a publisher
> script that doesn't seem to be executed when apache serves it.
> 
> I assumed I hitting the situation where I've hit an apache thread that
> had an 'older' running interpreter?
> 
> I'm using apache 2.0.53 prefork and modpython 3.1.3. (on a suse 9.3
> linux system)(installed by rpm not source)

Your assessment may be correct but there is a further issue in 3.1.3, 
where you can have 2 files with the same name (index.py) in different 
directories. The file that will by subsequent requests in a given 
process will depend on which on one got loaded first. As a result you 
can flip between 2 different outputs. Version 3.2.8 is an improvement 
and you are much less likely to see this sort of problem for simple 
cases. Graham is working on a new importer for 3.3 which will hopefully 
be a more complete solution. Upgrade to 3.2.8 if you can, or restart 
apache when you make changes in your code and avoid duplicate file 
names. Using 3.1.x really can be a PIA.

Jim




More information about the Mod_python mailing list