Re: kill -KILL: What happens? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: kill -KILL: What happens?
Date
Msg-id 4804.1294948878@sss.pgh.pa.us
Whole thread Raw
In response to Re: kill -KILL: What happens?  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: kill -KILL: What happens?  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> On Thu, Jan 13, 2011 at 2:45 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> I wonder whether we could have some sort of latch-like counter that
>> would count the number of active backends and deliver signals when the
>> count went to zero. �However, if the goal is to defend against random
>> applications of SIGKILL, there's probably no way to make this reliable
>> in userspace.

> I don't think you can get there 100%.  We could, however, make a rule
> that when a background process fails a PostmasterIsAlive() check, it
> sends SIGQUIT to everyone it can find in the ProcArray, which would at
> least ensure a timely exit in most real-world cases.

You're going in the wrong direction there: we're trying to have the
system remain sane when the postmaster crashes, not see how quickly
it can screw up every remaining session.

BTW, in Unix-land we could maybe rely on SysV semaphores' SEM_UNDO
feature to keep a trustworthy count of how many live processes there
are.  But I don't know whether there's anything comparable for Windows.
        regards, tom lane


pgsql-hackers by date:

Previous
From: "Ross J. Reedstrom"
Date:
Subject: Re: Allowing multiple concurrent base backups
Next
From: Aidan Van Dyk
Date:
Subject: Re: kill -KILL: What happens?