Re: kill -KILL: What happens?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Aidan Van Dyk <aidan(at)highrise(dot)ca>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Florian Pflug <fgp(at)phlo(dot)org>, David Fetter <david(at)fetter(dot)org>, PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: kill -KILL: What happens?
Date: 2011-01-13 20:42:36
Message-ID: 7688.1294951356@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Aidan Van Dyk <aidan(at)highrise(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Josh Berkus 2011-01-13 20:57:03 Re: Allowing multiple concurrent base backups
Previous Message Magnus Hagander 2011-01-13 20:40:11 Re: kill -KILL: What happens?