Re: windows doesn't notice backend death

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>, Magnus Hagander <magnus(at)hagander(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: windows doesn't notice backend death
Date: 2009-05-03 22:04:17
Message-ID: 3157.1241388257@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2009-05-03 23:17:09 Re: pg_resetxlog bug?
Previous Message Andrew Dunstan 2009-05-03 21:28:29 Re: windows doesn't notice backend death