--
Ticket URL: <https://code.djangoproject.com/ticket/17998>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* cc: anssi.kaariainen@… (added)
* needs_better_patch: => 0
* stage: Unreviewed => Accepted
* needs_tests: => 0
* needs_docs: => 0
Comment:
I have looked into this a little, but I can't see where the connection is
shared between the threads. Any ideas? It should be impossible to get the
same `DatabaseWrapper` in different threads unless explicitly shared. Of
course, it is possible there is a but making it not so impossible, which
would be more serious.
While I haven't reproduced this bug, I am still going to mark this
accepted, as I have seen some strange threading errors, too (caused by
using ipdb in my case, though).
--
Ticket URL: <https://code.djangoproject.com/ticket/17998#comment:1>
* stage: Accepted => Unreviewed
Comment:
I am going to revert the accepted triaging. I have been trying to
reproduce this, and I can't. The method I have been using is a test view
which does a database query and then sleeps a little. Then I hit that view
continuously with high-concurrency AB benchmark. No errors.
In addition I have been reading the code, and I can't see a way the
connection would get shared between threads.
So, more info is needed.
--
Ticket URL: <https://code.djangoproject.com/ticket/17998#comment:2>
* status: new => closed
* resolution: => worksforme
Comment:
I can't reproduce this and I haven't seen other complaints about this.
Closing this as worksforme.
--
Ticket URL: <https://code.djangoproject.com/ticket/17998#comment:3>
Comment (by trey9000):
The bug turned out to be in the django_digest package that we were using.
See some discussion here:
https://bitbucket.org/akoha/django-digest/issue/10/conflict-with-global-
databasewrapper
A patched version of django-digest that works for me can be found here:
https://github.com/trey0/django-digest
Sorry for reporting this in the wrong place...
--
Ticket URL: <https://code.djangoproject.com/ticket/17998#comment:4>
Comment (by anonymous):
got the same exception when enable
{{{
from gevent import monkey; monkey.patch_all()
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/17998#comment:5>
Comment (by anonymous):
Replying to [comment:5 anonymous]:
> got the same exception when enable
> {{{
> from gevent import monkey; monkey.patch_all()
> }}}
Could be fixed by not patching threads:
{{{
gevent.monkey.patch_all(socket=True, dns=True, time=True,
select=True,thread=False, os=True, ssl=True, httplib=False,
aggressive=True)
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/17998#comment:6>
Comment (by idbill@…):
I am recently had this issue occur after I increased the logging level on
a mod_wsgi instance.... I log quite a bit in debug mode, but rarely with
that setting on anything other than in my development environment (which
is usually running via runserver).
--
Ticket URL: <https://code.djangoproject.com/ticket/17998#comment:7>