Database connection not closed

Bug #1231332 reported by Michael Nelson
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Software Center Agent
Fix Released
Undecided
Michael Nelson
Ubuntu Apps Directory
Fix Committed
Undecided
Michael Nelson
ubuntu-recommender
Fix Committed
Undecided
Michael Nelson

Bug Description

We are seeing hung connections from myapps, recommender and ubuntu-webcatalog, which is stopping the database compact from running.

The work-around was to kill those hung transactions and enable the compact to run, but then the apps don't get a new db connection and continue trying to use the old one [1].

Related RT: 64831

[1] https://oops.canonical.com/?oopsid=OOPS-0182de64c2f0118ca16b0af2898c76f7 - traceback for posterity: https://pastebin.canonical.com/98059/

Revision history for this message
Michael Nelson (michael.nelson) wrote :

Regarding the hung transactions, see this note from the Django 1.5 release notes [1]. We should check our wsgi middleware (oops?) and ensure it's explicitly closing the response object.

[1] https://docs.djangoproject.com/en/dev/releases/1.5/#request-finished-signal

Revision history for this message
Michael Nelson (michael.nelson) wrote :

Another stab in the dark before I move on, regarding the re-using of transactions, see this note from the Django 1.4 release notes [1], although we upgraded past 1.4 quite a while ago.

[1] https://docs.djangoproject.com/en/dev/releases/1.4/#database-connection-s-thread-locality

description: updated
Revision history for this message
Tom Haddon (mthaddon) wrote :

This doesn't look too healthy - https://pastebin.canonical.com/98455/

Revision history for this message
Michael Nelson (michael.nelson) wrote :

bigkevmcd says that they experienced the same issue and found that updating to python-oops-wsgi r36 fixed it, (which indeed, adds the close() call):

http://bazaar.launchpad.net/~canonical-launchpad-branches/python-oops-wsgi/trunk/revision/36

Changed in software-center-agent:
status: New → In Progress
assignee: nobody → Michael Nelson (michael.nelson)
Revision history for this message
Michael Nelson (michael.nelson) wrote :

I've added python-oops-wsgi r36 to the sourcedeps of software-center-agent, web catalog, recommender and ratings and reviews.

Changed in software-center-agent:
status: In Progress → Fix Committed
Changed in ubuntu-webcatalog:
status: New → Fix Committed
Changed in ubuntu-recommender:
status: New → Fix Committed
Changed in ubuntu-webcatalog:
assignee: nobody → Michael Nelson (michael.nelson)
Changed in ubuntu-recommender:
assignee: nobody → Michael Nelson (michael.nelson)
Changed in software-center-agent:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.