In article <rnospamon-a73662.15010729012...@news.gha.chartermi.net>,
 Ron Garret <rnospa...@flownet.com> wrote:

> I'm running mod_wsgi under apache (on Debian etch so it's a somewhat out 
> of date version, though I doubt that has anything to do with this issue).
> 
> I have a little test page that displays the process ID under which my 
> app is running, and some global state, so I can tell when the wsgi app 
> gets reloaded.  This mostly only happens when I restart apache, but it 
> also seems to happen when my WSGI app does an HTTP 302 redirect.  (I'm 
> actually using Yaro and calling req.redirect, but that only does a 
> straightforward HTTP 302 redirect as far as I can tell.)  It not only 
> resets the global state, but changes process ID, so it seems to be doing 
> a complete restart of mod_wsgi, which seems a little excessive.
> 
> My question is: is this supposed to be happening?  Or is this an 
> indication that something is wrong, and if so, what?
> 
> Thanks,
> rg

Here's a standalone WSGI app demonstrating the phenomenon:

def redirect_test(env, start):
  if env['PATH_INFO']:
    start('302 Found', [('Location', '/')])
    return ['Redirecting']
  else:
    start('200 OK', [('Content-type', 'text/plain')])
    return ['PID', str(os.getpid())]
  pass

application = redirect_test


Fire this up under mod_wsgi and observe that the process ID stays the 
same when you reload the app.  Now add a path component to trigger the 
redirect and observe that process ID changes.

rg
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to