1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-28 23:42:10 +03:00

Tighten up error recovery for fast-path locking.

The previous code could cause a backend crash after BEGIN; SAVEPOINT a;
LOCK TABLE foo (interrupted by ^C or statement timeout); ROLLBACK TO
SAVEPOINT a; LOCK TABLE foo, and might have leaked strong-lock counts
in other situations.

Report by Zoltán Böszörményi; patch review by Jeff Davis.
This commit is contained in:
Robert Haas
2012-04-18 11:17:30 -04:00
parent ab77b2da8b
commit 53c5b869b4
7 changed files with 94 additions and 31 deletions

View File

@ -2259,7 +2259,7 @@ AbortTransaction(void)
* Also clean up any open wait for lock, since the lock manager will choke
* if we try to wait for another lock before doing this.
*/
LockWaitCancel();
LockErrorCleanup();
/*
* check the current transaction state
@ -4144,7 +4144,7 @@ AbortSubTransaction(void)
AbortBufferIO();
UnlockBuffers();
LockWaitCancel();
LockErrorCleanup();
/*
* check the current transaction state