Re: windows doesn't notice backend death - Mailing list pgsql-hackers

From Tom Lane
Subject Re: windows doesn't notice backend death
Date
Msg-id 3157.1241388257@sss.pgh.pa.us
Whole thread Raw
In response to Re: windows doesn't notice backend death  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: windows doesn't notice backend death  (Magnus Hagander <magnus@hagander.net>)
List pgsql-hackers
I wrote:
> The first idea that comes to mind is to have some sort of "dead man
> switch" that flags an active backend and is reset by proc_exit() after
> it's finished cleaning up everything else.  If the postmaster sees
> this flag still set after backend exit, then it treats the backend as
> having crashed regardless of what the reported exit code is.

Another thought that came to mind: we could set up an atexit hook that
does all the work that proc_exit() currently does, and reduce
proc_exit() itself to just an exit() call.  psql already relies on
having atexit (or on_exit) so this doesn't appear to add any new
portability issues.

This will probably not fix the Vista taskmanager issue, since I'll
bet it's not running atexit hooks anyway.  What it would do is improve
the situation so that a "clueless" exit() call would be no worse than
elog(FATAL), rather than triggering a DB-wide restart as the dead man
switch would do.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: windows doesn't notice backend death
Next
From: Tom Lane
Date:
Subject: Re: pg_resetxlog bug?