diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2008-01-26 19:55:08 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2008-01-26 19:55:08 +0000 |
commit | 6322e84430e2b1756fbf31072679507266f2b304 (patch) | |
tree | 27ba528789d651db8cb7f19ba6e904c97a2cde36 /src/include/storage/proc.h | |
parent | ace1b29b047ffa9474275078065ca697f0d69852 (diff) | |
download | postgresql-6322e84430e2b1756fbf31072679507266f2b304.tar.gz postgresql-6322e84430e2b1756fbf31072679507266f2b304.zip |
Change StatementCancelHandler() to check the DoingCommandRead flag to decide
whether to execute an immediate interrupt, rather than testing whether
LockWaitCancel() cancelled a lock wait. The old way misclassified the case
where we were blocked in ProcWaitForSignal(), and arguably would misclassify
any other future additions of new ImmediateInterruptOK states too. This
allows reverting the old kluge that gave LockWaitCancel() a return value,
since no callers care anymore. Improve comments in the various
implementations of PGSemaphoreLock() to explain that on some platforms, the
assumption that semop() exits after a signal is wrong, and so we must ensure
that the signal handler itself throws elog if we want cancel or die interrupts
to be effective. Per testing related to bug #3883, though this patch doesn't
solve those problems fully.
Perhaps this change should be back-patched, but since pre-8.3 branches aren't
really relying on autovacuum to respond to SIGINT, it doesn't seem critical
for them.
Diffstat (limited to 'src/include/storage/proc.h')
-rw-r--r-- | src/include/storage/proc.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/include/storage/proc.h b/src/include/storage/proc.h index 5b7c7ec4e03..1ce3eb26fc3 100644 --- a/src/include/storage/proc.h +++ b/src/include/storage/proc.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/storage/proc.h,v 1.103 2008/01/01 19:45:59 momjian Exp $ + * $PostgreSQL: pgsql/src/include/storage/proc.h,v 1.104 2008/01/26 19:55:08 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -166,7 +166,7 @@ extern void ProcQueueInit(PROC_QUEUE *queue); extern int ProcSleep(LOCALLOCK *locallock, LockMethod lockMethodTable); extern PGPROC *ProcWakeup(PGPROC *proc, int waitStatus); extern void ProcLockWakeup(LockMethod lockMethodTable, LOCK *lock); -extern bool LockWaitCancel(void); +extern void LockWaitCancel(void); extern void ProcWaitForSignal(void); extern void ProcSendSignal(int pid); |