Re: [HACKERS] PATCH: Keep one postmaster monitoring pipe per process

From: Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Marco Pfatschbacher <Marco_Pfatschbacher(at)genua(dot)de>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [HACKERS] PATCH: Keep one postmaster monitoring pipe per process
Date: 2018-04-18 06:55:52
Message-ID: CAEepm=2XSKf_zN2MGG=3UXqLQ242pCUVGE-e7+S7Rrmkd+B36w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

I'd like to disentangle two related topics. For "I want
PostmasterIsAlive() to go faster using signals on platforms that can
support that", please see over here:

https://www.postgresql.org/message-id/flat/7261eb39-0369-f2f4-1bb5-62f3b6083b5e(at)iki(dot)fi#7261eb39-0369-f2f4-1bb5-62f3b6083b5e@iki.fi

For "I want to fix all the code that ignores the WL_POSTMASTER_DEATH
event and then calls PostmasterIsAlive() every time through its loop,
or fails to detect postmaster death at all", this is the thread
(unless someone sees a reason to reentangle them).

Here's a draft patch that does that. One contentious question is:
should you have to opt *in* to auto-exit-on-postmaster death? Andres
opined that you should. I actually think it's not so bad if you don't
have to do that, and instead have to opt out. I think of it as a kind
of 'process cancellation point' or a quiet PANIC that you can opt out
of. It's nice to remove the old boilerplate code without having to
add a new boilerplate event that you have to remember every time. Any
other opinions?

I'm not sure if the exit(1) vs proc_exit(1) distinction is important.

--
Thomas Munro
http://www.enterprisedb.com

Attachment Content-Type Size
0001-Exit-by-default-in-wait-routines-if-postmaster-dies.patch application/octet-stream 29.3 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ashutosh Bapat 2018-04-18 07:53:06 Re: Problem while updating a foreign table pointing to a partitioned table on foreign server
Previous Message Pavan Deolasee 2018-04-18 06:37:52 Re: Bugs in TOAST handling, OID assignment and redo recovery