mirror of
https://github.com/postgres/postgres.git
synced 2025-09-02 04:21:28 +03:00
From: Tom Lane <tgl@sss.pgh.pa.us>
Making PQrequestCancel safe to call in a signal handler turned out to be much easier than I feared. So here are the diffs. Some notes: * I modified the postmaster's packet "iodone" callback interface to allow the callback routine to return a continue-or-drop-connection return code; this was necessary to allow the connection to be closed after receiving a Cancel, rather than proceeding to launch a new backend... Being a neatnik, I also made the iodone proc have a typechecked parameter list. * I deleted all code I could find that had to do with OOB. * I made some edits to ensure that all signals mentioned in the code are referred to symbolically not by numbers ("SIGUSR2" not "2"). I think Bruce may have already done at least some of the same edits; I hope that merging these patches is not too painful.
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/async.c,v 1.34 1998/06/27 04:53:29 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/async.c,v 1.35 1998/07/09 03:28:44 scrappy Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -21,11 +21,11 @@
|
||||
* 2.a If the process is the same as the backend process that issued
|
||||
* notification (we are notifying something that we are listening),
|
||||
* signal the corresponding frontend over the comm channel.
|
||||
* 2.b For all other listening processes, we send kill(2) to wake up
|
||||
* 2.b For all other listening processes, we send kill(SIGUSR2) to wake up
|
||||
* the listening backend.
|
||||
* 3. Upon receiving a kill(2) signal from another backend process notifying
|
||||
* that one of the relation that we are listening is being notified,
|
||||
* we can be in either of two following states:
|
||||
* 3. Upon receiving a kill(SIGUSR2) signal from another backend process
|
||||
* notifying that one of the relation that we are listening is being
|
||||
* notified, we can be in either of two following states:
|
||||
* 3.a We are sleeping, wake up and signal our frontend.
|
||||
* 3.b We are in middle of another transaction, wait until the end of
|
||||
* of the current transaction and signal our frontend.
|
||||
@@ -46,7 +46,7 @@
|
||||
* (which takes place after commit) to all listeners on this relation.
|
||||
*
|
||||
* 3. Async. notification results in all backends listening on relation
|
||||
* to be woken up, by a process signal kill(2), with name of relation
|
||||
* to be woken up, by a process signal kill(SIGUSR2), with name of relation
|
||||
* passed in shared memory.
|
||||
*
|
||||
* 4. Each backend notifies its respective frontend over the comm
|
||||
|
Reference in New Issue
Block a user