postgresql/src
Tom Lane 969d7cd431 Install a "dead man switch" to allow the postmaster to detect cases where
a backend has done exit(0) or exit(1) without having disengaged itself
from shared memory.  We are at risk for this whenever third-party code is
loaded into a backend, since such code might not know it's supposed to go
through proc_exit() instead.  Also, it is reported that under Windows
there are ways to externally kill a process that cause the status code
returned to the postmaster to be indistinguishable from a voluntary exit
(thank you, Microsoft).  If this does happen then the system is probably
hosed --- for instance, the dead session might still be holding locks.
So the best recovery method is to treat this like a backend crash.

The dead man switch is armed for a particular child process when it
acquires a regular PGPROC, and disarmed when the PGPROC is released;
these should be the first and last touches of shared memory resources
in a backend, or close enough anyway.  This choice means there is no
coverage for auxiliary processes, but I doubt we need that, since they
shouldn't be executing any user-provided code anyway.

This patch also improves the management of the EXEC_BACKEND
ShmemBackendArray array a bit, by reducing search costs.

Although this problem is of long standing, the lack of field complaints
seems to mean it's not critical enough to risk back-patching; at least
not till we get some more testing of this mechanism.
2009-05-05 19:59:00 +00:00
..
backend Install a "dead man switch" to allow the postmaster to detect cases where 2009-05-05 19:59:00 +00:00
bin Code review for \df rewrite: fix assorted bugs, make type and 2009-05-05 02:29:06 +00:00
include Install a "dead man switch" to allow the postmaster to detect cases where 2009-05-05 19:59:00 +00:00
interfaces Fix already-obsolete hint message ... sslverify parameter is no more. 2009-05-03 17:16:58 +00:00
makefiles
pl Fix plpgsql's EXIT so that an EXIT without a label only matches a loop, 2009-05-02 17:27:57 +00:00
port Update no longer current comments in header. 2009-05-04 09:30:06 +00:00
template
test Disable the use of Unicode escapes in string constants (U&'') when 2009-05-05 18:32:17 +00:00
timezone Update time zone data files to tzdata release 2009e: DST law changes in 2009-04-09 20:50:42 +00:00
tools Replace a couple of references to files that no longer exist in the source 2009-05-04 08:08:47 +00:00
tutorial
bcc32.mak
DEVELOPERS Replace a couple of references to files that no longer exist in the source 2009-05-04 08:08:47 +00:00
Makefile Add the possibility to specify an explicit validator function for foreign-data 2009-02-24 10:06:36 +00:00
Makefile.global.in
Makefile.shlib
nls-global.mk
win32.mak