pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@anarazel.de>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Noah Misch <noah@leadboat.com>
Cc: Thomas Munro <thomas.munro@gmail.com>
Cc: pgsql-committers <pgsql-committers@lists.postgresql.org>
Subject: Re: pgsql: TAP tests: check for postmaster.pid anyway when "pg_ctl start" f
Date: Thu, 10 Feb 2022 14:38:06 -0800
Message-ID: <20220210223806.ikpf57pz2ilamqam@alap3.anarazel.de> (raw)
In-Reply-To: <1709793.1644523137@sss.pgh.pa.us>
References: <E1nAIWI-0006et-HW@gemulon.postgresql.org>
	<CA+hUKGKV6fOHvfiPt8=dOKzvswjAyLoFoJF1iQXMNpi7+hD1JQ@mail.gmail.com>
	<855583.1642687119@sss.pgh.pa.us>
	<867290.1642689136@sss.pgh.pa.us>
	<20220120192736.msyesvdlljn6tptw@alap3.anarazel.de>
	<926839.1642708567@sss.pgh.pa.us>
	<1075553.1642717844@sss.pgh.pa.us>
	<20220210023537.GA3222837@rfd.leadboat.com>
	<1709793.1644523137@sss.pgh.pa.us>

Hi,

On 2022-02-10 14:58:57 -0500, Tom Lane wrote:
> So it looks to me like the core problem is that pg_ctl's do_stop()
> is too trusting: if it once sees the postmaster PID as alive, it
> figures that's the end of the story.

Agreed, that's a problem. Even if it wasn't the cause of slot tests on AIX.

kill -9 can be slow on other operating systems as well. I think on linux for
example it's not processed immediately if already in the middle of dumping
core.


> (do_restart and do_promote seem similarly naive ... and why are there so
> many copies of the wait loop, anyway?)

:(

There's generally some confusing duplication in pg_ctl.c itself, and between
pg_ctl and other programs. E.g. CreateRestrictedProcess() existing both in
pg_ctl and slightly differently in restricted_token.c. Wut? Also why is
restricted_token.c in common/, rather than port?


> Another idea is to modify Cluster.pm's kill9 to not return until the
> PID is gone according to kill(0).  On the other hand, that'd mask
> problems like this, so I'm not entirely enthused about changing
> that end of things.

Seems reasonable.

Greetings,

Andres Freund





view thread (20+ messages)  latest in thread

Message-ID: <20220210223806.ikpf57pz2ilamqam@alap3.anarazel.de>
Permalink:  ../20220210223806.ikpf57pz2ilamqam@alap3.anarazel.de/
Also on:    postgresql.org/message-id/20220210223806.ikpf57pz2ilamqam@alap3.anarazel.de

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: andres@anarazel.de, tgl@sss.pgh.pa.us, noah@leadboat.com, thomas.munro@gmail.com, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: TAP tests: check for postmaster.pid anyway when "pg_ctl start" f
  In-Reply-To: <20220210223806.ikpf57pz2ilamqam@alap3.anarazel.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox