mod_python: delay in files changing after alteration

P

psaffrey

Maybe this is an apache question, in which case apologies.

I am running mod_python 3.3.1-3 on apache 2.2.9-7. It works fine, but
I find that when I alter a source file during development, it
sometimes takes 5 seconds or so for the changes to be seen. This might
sound trivial, but when debugging tens of silly errors, it's annoying
that I have to keep hitting refresh on my browser waiting for the
change to "take". I'm guessing this is just a caching issue of some
kind, but can't figure out how to switch it off. Any suggestions?

The entry in my apache2.conf looks like this:

<Directory /var/www/pythonapps>
SetHandler mod_python
PythonHandler mod_python.publisher
PythonDebug On
</Directory>


Thanks,

Peter
 
S

Stephen Chapman

I have never noticed any such delay. After making a change I just hit
F5 on my browser and its fine. Maybe its a browser issue
 
G

Graham Dumpleton

Maybe this is an apache question, in which case apologies.

I am runningmod_python3.3.1-3 on apache 2.2.9-7. It works fine, but
I find that when I alter a source file during development, it
sometimes takes 5 seconds or so for the changes to be seen. This might
sound trivial, but when debugging tens of silly errors, it's annoying
that I have to keep hitting refresh on my browser waiting for the
change to "take". I'm guessing this is just a caching issue of some
kind, but can't figure out how to switch it off. Any suggestions?

The entry in my apache2.conf looks like this:

<Directory /var/www/pythonapps>
   SetHandlermod_python
   PythonHandlermod_python.publisher
   PythonDebug On
</Directory>

If the change is to a Python module installed on sys.path the change
would never be reloaded by a process. If you are seeing a delay, it is
probably only because the request is being handled by a different
Apache child process that has never loaded the code before. This is
all because Apache is a multiprocess web server on UNIX.

Thus, any changes to modules/packages installed on sys.path require a
full restart of Apache to ensure they are loaded by all Apache child
worker processes.

So, which code files are you actually modifying, ie., where do they
exist and how are they imported?

Graham
 
P

psaffrey

Thus, any changes to modules/packages installed on sys.path require a
full restart of Apache to ensure they are loaded by all Apache child
worker processes.

That will be it. I'm pulling in some libraries of my own from
elsewhere, which are still being modified to accommodate the web app.
These are the changes that are causing the problems. An Apache restart
isn't too onerous - I'll just start doing that.

Thanks,

Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,153
Members
46,699
Latest member
AnneRosen

Latest Threads

Top