On Fri, Sep 24, 2010 at 11:38 PM, Remy Blank <remy.bl...@pobox.com> wrote:

> Itamar O wrote:
> > I also searched Trac& plugins code for _wrap and found none.
> > It might be mod_wsgi, although I have a feeling it's in python-svn
> > bindings, which seems to be a weak-spot with Windows set ups...
>
> Good guess. The class apr_pool_t defined in libsvn/core.py has a method
> _wrap(). But it's not called explicitly from either the bindings or
> Trac, so this is probably hardly any help.
>
> -- Remy
>
>
Managed to workaround the issue, I think.

I looked into the modwsgi WSGIApplicationGroup directive [1],
and noticed that the %{SERVER} value (that I used) invokes a new Python
interpreter for every VirtualHost I have, which lends itself to threading
issues. So I changed it to %{GLOBAL} (which forces all requests to be
handled by the first interpreter invoked).
>From the description of the%{GLOBAL} value in [1]:
 Forcing a WSGI application to run within the first interpreter can be
necessary when a third party C extension module for Python has used the
simplified threading API for manipulation of the Python GIL and thus will
not run correctly within any additional sub interpreters created by Python.
So this might be the case for python-svn-bindings...

But when I changed all VHost accordingly, it seemed that the single
interpreter was unable to deal with multiple wsgi-scripts (e.g., accessing
proj1 loads proj1.wsgi, then accessing proj2 loads proj2.wsgi which
overwrites proj1, then accessing proj1 again returns content from proj2
instead...).
To overcome this I had to improve the strategy of the single sites.wsgi
script with SetEnv in the apache conf to select the served environment (this
was somewhat complex, as I have several "single envs" and several "parent
dirs" that are located "under" single envs...).

By the way, during the process I found out that modwsgi-3.3 was released
several weeks ago ([2]), which (among other things) solves an issue with
Python-2.6.5+ that caused harmless errors to be logged by apache (something
with KeyError in threading module when the server stops).

[1]
http://code.google.com/p/modwsgi/wiki/ConfigurationDirectives#WSGIApplicationGroup
[2] http://code.google.com/p/modwsgi/wiki/ChangesInVersion0303

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Development" group.
To post to this group, send email to trac-...@googlegroups.com.
To unsubscribe from this group, send email to 
trac-dev+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/trac-dev?hl=en.

Reply via email to