On Jul 19, 2:07 pm, "Russell Keith-Magee" <[EMAIL PROTECTED]>
wrote:
> On 7/19/07, oggie rob <[EMAIL PROTECTED]> wrote:
>
> > Please, if you've seen the same issue or have any helpful ideas to try
> > to stop the error, let me know.
>
> I think I've seen the same problem (or, at least, an analogous one).
> Unfortunately, I can't provide much by way of helpful debug or
> solution - the sysadmin that identified the problem for us isn't
> around for me to ask him for more details.
>
> As I recall, the problem was mod_python. Older versions of mod_python
> had some sort of issue with caching python instances. As a result, if
> you deployed two different versions of Django, the version of Django
> that was provided to a given request was determined by the thread that
> served the request. If the first request served by a thread used the
> old version of Django, that was the version that was used for all
> subsequent requests on that thread, regardless of the version that was
> required to satisfy the request.

For the record, the description which was given to you whereby "if the
first request served by a thread used the old version of Django, that
was the version that was used for all subsequent requests on that
thread" is nonsense. There has never been a problem with mod_python
which would have caused that sort of behaviour.

> I believe we fixed the problem by updating mod_python, but I'm not
> completely certain on that.

Always a good idea regardless. Using mod_python 3.3.1 is high
recommended.

Where problems can come up with hosting multiple Django instances is
not with mod_python or Django, but with third party C extension
modules which haven't been written correctly so as to be used
concurrently from multiple Python sub interpreters.

One concrete example which was identified recently was Decimal support
in pyscopg module.

  http://www.initd.org/tracker/psycopg/ticket/192

In short, a C extension module may cache data from one sub interpreter
and then use it in the context of a different sub interpreter causing
incorrect or errornous behaviour. The problem with Decimal support in
pyscopg falls into this category. It is entirely possible that the OP
may have been hitting a similar obscure problem in the database
adapter being used.

The only real way to ensure that such a problem isn't encountered is
to use mod_fastcgi or mod_wsgi daemon mode. In both these hosting
solutions for Apache the Django instance can be run in a distinct
process and thus one doesn't encounter issues with C extension modules
that aren't written to work with multiple sub interpreters properly.

Graham


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to