Ivan Sagalaev wrote:

>However this patch revealed pretty nasty show-stopper bug: we leak 
>connections somewhere. For even a simple view that does only a single 
>select connection is opened, then closed and then opened again and never 
>closed.
>
Found it. Both modpython.py and wsgi.py have this bit:

    try:
        request = ModPythonRequest(req)
        response = self.get_response(req.uri, request)
    finally:
        db.db.close()

    # Apply response middleware
    for middleware_method in self._response_middleware:
        response = middleware_method(request, response)

.. meaning that if any response middleware uses db connection (like 
Session) it's not closed.  I've filed a ticket: 
http://code.djangoproject.com/ticket/1445

Now it looks like the issue always was here. It doesn't show up in 
non-threaded environment or if Apache kills its children faster then 
Postgres reaches connection limit. Let's discuss ways of fixing it in 
the ticket.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@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-developers
-~----------~----~----~----~------~----~------~--~---

Reply via email to