mirror of
https://github.com/postgres/postgres.git
synced 2025-06-27 23:21:58 +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:
@ -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--;
|
||||
|
Reference in New Issue
Block a user