database adapter serialisation tests disabled

Bug #131043 reported by James Henstridge
4
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
High
Unassigned
psycopg
Fix Released
Unknown

Bug Description

The database adapter serialisation tests started failing again when mthaddon was trying to merge the new Bazaar release.

I have moved them out of the test_adapter.txt page test into a separate adapter-serialisation.txt doctest, and disabled that test (so the remainder of test_adapter.txt is still in force). We should re-enable this test when we work out a real fix for the problem.

The bug is marked critical at the request of SteveA.

Changed in launchpad:
importance: Undecided → Critical
status: New → Confirmed
Revision history for this message
James Henstridge (jamesh) wrote :

To re-enable the test, uncomment the appropriate lines in lib/canonical/launchpad/webapp/ftests/test_adapter.py.

This appears to be the same errors we were seeing previously in bug 32231.

Revision history for this message
Stuart Bishop (stub) wrote :

We need the output of the failure as we probably won't be able to reproduce this locally.

Revision history for this message
James Henstridge (jamesh) wrote :

The output of Tom's test suite run is:
    https://devpad.canonical.com/~mthaddon/2007-07-31-bzr-upgrade-failure.txt

It appears to be the same exception as in bug 32231 (as mentioned in my previous comment).

Revision history for this message
James Henstridge (jamesh) wrote :

Steve asked for an explanation of the problem, so here goes:

the commit() and rollback() implementations in psycopg1 have a weird error handling: if the statement can't be executed or the result status is not PGRES_COMMAND_OK, then it calls pgconn_set_critical(). This function stores the error message in the cursor.

Most psycopg cursor methods call the EXC_IFCRITICAL() macro which calls pgconn_resolve_critical() if an error message has previously been set with pgconn_set_critical(). The pgconn_resolve_critical() closes the connection and raises a Python exception.

So a failed commit() or abort() can end up closing the connection. I believe this is the root cause of the problem we've seen, and I guess it is down to timing on which statement in the test fails. If it is the commit, then the connection is screwed.

There is similar code in psycopg2, and I submitted a bug report with a test case that exercises the bug.

Changed in psycopg:
status: Unknown → New
Revision history for this message
Joey Stanford (joey) wrote :

Per conversation with Steve, demoting this to high.

Changed in launchpad:
importance: Critical → High
Changed in psycopg:
status: New → Fix Released
Revision history for this message
James Henstridge (jamesh) wrote :

As part of the work on improving psycopg2 for use with Storm and Launchpad, I've greatly reduced the use of the set_critical()/resolve_critical() code. So this test should not hit the bug when we move over to that version.

Revision history for this message
James Henstridge (jamesh) wrote :

As these tests have been replicated in the psycopg2 test suite, we can probably remove them completely from the LP test suite when switching over to Storm.

Stuart Bishop (stub)
Changed in launchpad-foundations:
status: Confirmed → 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.