aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/transam/xact.c
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2012-04-18 11:17:30 -0400
committerRobert Haas <rhaas@postgresql.org>2012-04-18 11:17:30 -0400
commit53c5b869b464d567c3b8f617201b49a395f437ab (patch)
tree60377296105651401329bc604e06deb54a4e8216 /src/backend/access/transam/xact.c
parentab77b2da8bf2cd1c8068f2f90e95c42d426aba3c (diff)
downloadpostgresql-53c5b869b464d567c3b8f617201b49a395f437ab.tar.gz
postgresql-53c5b869b464d567c3b8f617201b49a395f437ab.zip
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.
Diffstat (limited to 'src/backend/access/transam/xact.c')
-rw-r--r--src/backend/access/transam/xact.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/access/transam/xact.c b/src/backend/access/transam/xact.c
index d8523f37b2f..7f412b10d75 100644
--- a/src/backend/access/transam/xact.c
+++ b/src/backend/access/transam/xact.c
@@ -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