[patch] django.contrib.auth.handlers.modpython doesn't send signals.request_*, leaks db connections
|Reported by:||Owned by:||Malcolm Tredinnick|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
The module django.contrib.auth.handlers.modpython does not send signals.request_started before it begins processing, and more importantly, doesn't send signals.request_finished once it's completed, which means that the callback established by the line """dispatcher.connect(connection.close, signal=signals.request_finished)""" in django.db's init.py is never called.
As such, the database connection is not closed (until the python interpreter is culled, eg when apache2 restarts) and is left to fester. I spotted this as I was using it to authenticate all access to an SVN repository, and "svn diff" was making so many requests that eventually postgres gave an error of "connection limit exceeded for non-superusers".
Patch to follow.
Change History (7)
comment:1 Changed 10 years ago by
|Summary:||django.contrib.auth.handlers.modpython doesn't send signals.request_*, leaks db connections → [patch] django.contrib.auth.handlers.modpython doesn't send signals.request_*, leaks db connections|