Re: PATCH: Keep one postmaster monitoring pipe per process

Andres Freund <andres@anarazel.de>

From: Andres Freund <andres@anarazel.de>
To: Thomas Munro <thomas.munro@enterprisedb.com>
Cc: Marco Pfatschbacher <Marco_Pfatschbacher@genua.de>, Pg Hackers <pgsql-hackers@postgresql.org>
Date: 2016-09-19T23:26:06Z
Lists: pgsql-hackers
On 2016-09-20 11:07:03 +1200, Thomas Munro wrote:
> Yeah, I wondered why that was different than the pattern established
> elsewhere when I was hacking on replication code.  There are actually
> several places where we call PostmasterIsAlive() unconditionally in a
> loop that waits for WL_POSTMASTER_DEATH but ignores the return code:

Note that just changing this implies a behavioural change in at least
some of those: If the loop is busy with work, the WaitLatch might never
be reached.  I think that might be ok in most of those, but it does
require examination.

- Andres


Commits

  1. Add WL_EXIT_ON_PM_DEATH pseudo-event.

  2. Use signals for postmaster death on Linux.