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

From Tom Lane
Subject Re: kill -KILL: What happens?
Date
Msg-id 7688.1294951356@sss.pgh.pa.us
Whole thread Raw
In response to Re: kill -KILL: What happens?  (Aidan Van Dyk <aidan@highrise.ca>)
Responses Re: kill -KILL: What happens?  (Florian Pflug <fgp@phlo.org>)
List pgsql-hackers
Aidan Van Dyk <aidan@highrise.ca> writes:
> If postmaster has a few fds to spare, what about having it open a pipe
> to every child it spawns.  It never has to read/write to it, but
> postmaster closing will signal the client's fd.  The client just has
> to pop the fd into whatever nrmal poll/select event handlign it uses
> to notice when the "parent's pipe" is closed.

Hmm.  Or more generally: there's one FIFO.  The postmaster holds both
sides open.  Backends hold the write side open.  (They can close the
read side, but that would just be to free up a FD.)  Background children
close the write side.  Now a background process can use EOF on the read
side of the FIFO to tell it that postmaster and all backends have
exited.  You still don't get a signal, but at least the condition you're
testing for is the one we actually want and not an approximation.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Magnus Hagander
Date:
Subject: Re: kill -KILL: What happens?
Next
From: Josh Berkus
Date:
Subject: Re: Allowing multiple concurrent base backups