Re: pgsql: TAP tests: check for postmaster.pid anyway when "pg_ctl start" f - Mailing list pgsql-committers

From Andres Freund
Subject Re: pgsql: TAP tests: check for postmaster.pid anyway when "pg_ctl start" f
Date
Msg-id 20220210225254.pds2dowte5yophmr@alap3.anarazel.de
Whole thread Raw
In response to Re: pgsql: TAP tests: check for postmaster.pid anyway when "pg_ctl start" f  (Andres Freund <andres@anarazel.de>)
Responses Re: pgsql: TAP tests: check for postmaster.pid anyway when "pg_ctl start" f
List pgsql-committers
Hi,

On 2022-02-10 14:38:06 -0800, Andres Freund wrote:
> 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.

Should we take the danger of postmaster dying without cleaning up the pid file
and then another process reusing that pid serious? That obviously could make
pg_ctl wait until timeout.

Postmaster always opening a named pipe or unix socket in the data directory
would allow to detect that, I guess. Or checking the shared memory segment for
attached processes, but that seems like a mess to do in pg_ctl.

Greetings,

Andres Freund



pgsql-committers by date:

Previous
From: Andres Freund
Date:
Subject: Re: pgsql: TAP tests: check for postmaster.pid anyway when "pg_ctl start" f
Next
From: Tom Lane
Date:
Subject: Re: pgsql: TAP tests: check for postmaster.pid anyway when "pg_ctl start" f