From: Tom Lane <tgl@sss.pgh.pa.us>
Marc G. Fournier <scrappy@hub.org>
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.
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/protocol.sgml | modified | +217 −42 |
| src/backend/commands/async.c | modified | +6 −6 |
| src/backend/libpq/auth.c | modified | +43 −29 |
| src/backend/libpq/pqcomm.c | modified | +2 −78 |
| src/backend/libpq/pqpacket.c | modified | +10 −8 |
| src/backend/postmaster/postmaster.c | modified | +102 −22 |
| src/backend/tcop/postgres.c | modified | +27 −13 |
| src/backend/utils/init/globals.c | modified | +3 −1 |
| src/bin/psql/psql.c | modified | +23 −9 |
| src/include/commands/dbcommands.h | modified | +2 −3 |
| src/include/libpq/libpq-be.h | modified | +11 −7 |
| src/include/libpq/libpq.h | modified | +3 −9 |
| src/include/libpq/pqcomm.h | modified | +20 −1 |
| src/include/miscadmin.h | modified | +3 −1 |
| src/include/port/sco.h | modified | +0 −1 |
| src/interfaces/libpq/fe-connect.c | modified | +99 −8 |
| src/interfaces/libpq/fe-exec.c | modified | +11 −39 |
| src/interfaces/libpq/libpq-fe.h | modified | +6 −2 |
| src/man/listen.l | modified | +2 −4 |
| src/man/notify.l | modified | +7 −4 |