Need to sniff ProgrammingError to catch some constraint violations in order to Retry

Bug #57388 reported by Stuart Bishop
12
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
Medium
Stuart Bishop
launchpad-dependencies (Ubuntu)
Fix Released
Medium
Steve Alexander

Bug Description

In most cases, psycopg raises psycopg.IntegrityError when a constraint has been violated. We catch this exception and raise a Retry exception to get Zope3 to attempt the transaction again. This fixes a huge number of race conditions.

It seems that psycopg will also raise psycopg.ProgrammingError in some cases too, such as in OOPS-230A138 :

ProgrammingError: ERROR: duplicate key violates unique constraint "person_name_key"

Stuart Bishop (stub)
Changed in launchpad:
assignee: nobody → stub
importance: Untriaged → Medium
status: Unconfirmed → Confirmed
Stuart Bishop (stub)
Changed in launchpad:
status: Confirmed → In Progress
Revision history for this message
Stuart Bishop (stub) wrote :

Turns out this is a bug in psycopg that has been fixed. We need update launchpad-dependancies to require psycopg >= 1.1.21 and update our production systems.

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

gangotri and gandwana have been updated to psycopg-1.1.21 so this should be fixed on the production systems.

Changed in launchpad:
status: In Progress → Fix Released
Changed in launchpad-dependencies:
importance: Untriaged → Medium
status: Unconfirmed → Confirmed
assignee: nobody → stevea
Stuart Bishop (stub)
Changed in launchpad-dependencies:
status: Confirmed → Fix Released
Curtis Hovey (sinzui)
visibility: private → public
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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