Connection permanently broken if transaction begin times out or fails
Bug #939287 reported by
Stuart Bishop
This bug affects 2 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Launchpad itself |
Triaged
|
High
|
Unassigned | ||
Storm |
Invalid
|
High
|
Unassigned |
Bug Description
If starting the transaction fails, such as the statement timeout kicking in, no abort is issued. At least with PostgreSQL, this leaves the connection in a broken state, as all future attempts to begin the transaction fail when trying to issue a BEGIN statement on a broken transaction.
Changed in storm: | |
importance: | Undecided → High |
status: | New → Confirmed |
Changed in storm: | |
status: | Confirmed → New |
Changed in launchpad: | |
status: | Confirmed → Triaged |
importance: | Undecided → High |
To post a comment you must log in.
We could attempt to catch the failure as it happens and issue an abort. However, the abort might also fail and we can't loop for ever.
The best approach is to abort the broken transaction before attempting to start a new one. Modern versions of psycopg2 may let us interrogate the connection state and abort it if necessary. We could also unconditionally issue an ABORT before the BEGIN, but this will create log spam in the PostgreSQL logs.