diff options
author | Robert Haas | 2012-04-18 15:17:30 +0000 |
---|---|---|
committer | Robert Haas | 2012-04-18 15:17:30 +0000 |
commit | 53c5b869b464d567c3b8f617201b49a395f437ab (patch) | |
tree | 60377296105651401329bc604e06deb54a4e8216 /src/backend/tcop/postgres.c | |
parent | ab77b2da8bf2cd1c8068f2f90e95c42d426aba3c (diff) |
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/tcop/postgres.c')
-rw-r--r-- | src/backend/tcop/postgres.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index d5369f412e2..51d623ff3e3 100644 --- a/src/backend/tcop/postgres.c +++ b/src/backend/tcop/postgres.c @@ -2575,7 +2575,7 @@ die(SIGNAL_ARGS) /* bump holdoff count to make ProcessInterrupts() a no-op */ /* until we are done getting ready for it */ InterruptHoldoffCount++; - LockWaitCancel(); /* prevent CheckDeadLock from running */ + LockErrorCleanup(); /* prevent CheckDeadLock from running */ DisableNotifyInterrupt(); DisableCatchupInterrupt(); InterruptHoldoffCount--; @@ -2617,7 +2617,7 @@ StatementCancelHandler(SIGNAL_ARGS) /* bump holdoff count to make ProcessInterrupts() a no-op */ /* until we are done getting ready for it */ InterruptHoldoffCount++; - LockWaitCancel(); /* prevent CheckDeadLock from running */ + LockErrorCleanup(); /* prevent CheckDeadLock from running */ DisableNotifyInterrupt(); DisableCatchupInterrupt(); InterruptHoldoffCount--; @@ -2776,7 +2776,7 @@ RecoveryConflictInterrupt(ProcSignalReason reason) /* bump holdoff count to make ProcessInterrupts() a no-op */ /* until we are done getting ready for it */ InterruptHoldoffCount++; - LockWaitCancel(); /* prevent CheckDeadLock from running */ + LockErrorCleanup(); /* prevent CheckDeadLock from running */ DisableNotifyInterrupt(); DisableCatchupInterrupt(); InterruptHoldoffCount--; |