Since , mod_python keeps a stale database connection for each HTTP request
|Reported by:||Owned by:||Adrian Holovaty|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
Since , a template is lazy-rendered. However under mod_python environment, the signal to close database connection (signals.request_finished) is sent before a template is actually rendered. If a connection is then reopened by demand during the rendering process, it will not be ever closed again and result in a stale connection, which soon overwhelms the database server.
Attached the proposed patch (sending the request_finished signal after the template is actually rendered).
Note: this can also fix #4612, though I'm not completely sure.