On 1 February 2010 23:14, Chris Curvey <[email protected]> wrote: > > > On Feb 1, 1:02 am, Graham Dumpleton <[email protected]> > wrote: >> On 1 February 2010 16:55, Chris Curvey <[email protected]> wrote: > [snip] > >> >> > import os >> > import sys >> > sys.path.append("c:/foobar") >> > sys.path.append("c:/foobar/foobar_service") >> > sys.path.append("c:/python26/lib/site-packages/xlrd-0.7.1-py2.6- >> > win32.egg") >> >> If that package was installed correctly in the first place, there >> shouldn't be a need to be adding that path explicitly like you are. >> This is because the site-packages directory should already be in your >> path and by that being so, the .pth in that directory which refers to >> the actual egg directory should have been read and the egg directory >> also automatically added to sys.path without you doing anything. This >> is not relevant to the problem though. > > I agree. I'm sure I had a good reason for doing this when I did it, > but the reason itself escapes me now. I will dig into it later. > > [snip] > >> >> All I can suggest is that your application is using a C extension >> module for Python and that modules implementation is not thread safe. >> Such problems in pure Python modules will not cause a crash, but for C >> extension modules you can get a crash like you see. >> >> What Python modules are you using that you installed yourself and >> which have a C extension module component? > > Aaaah, excellent insight. I have both the MySQLdb and pyodbc drivers > installed -- those are both C extensions. And I have a feeling (but I > can't prove it yet) that the problem is in my implementation of a > connection pool for the pyodbc driver. > > Now, if I can't find the problem in my python code, would a fallback > workaround be to build an Apache server for Windows with the "worker" > MPM, since that uses processes (rather than threads) to isolate > requests?
Windows only supports 'winnt' MPM, which is single process which is multithreaded. The 'worker' and 'prefork' MPMs are UNIX specific. See: http://code.google.com/p/modwsgi/wiki/ProcessesAndThreading > Update from while I'm typing this: I'm now getting some crashes when > running the server with the built-in Django webserver, rather than > with Apache + mod_wsgi. This seems to be happening when there is any > unhandled exception somewhere in the code. If you you mean complete process crash, as opposed to Python exception, then likely you have an outright C coding bug, possibly a reference counting mistake, in your personal C extension module. Graham -- You received this message because you are subscribed to the Google Groups "modwsgi" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/modwsgi?hl=en.
