From: Tom Lane <tgl@sss.pgh.pa.us>
To: Noah Misch <noah@leadboat.com>
Cc: pgsql-hackers@postgresql.org
Subject: Re: pg_regress: promptly detect failed postmaster startup
Date: Mon, 31 Dec 2018 13:51:31 -0500
Message-ID: <19454.1546282291@sss.pgh.pa.us> (raw)
In-Reply-To: <20181231172922.GA199150@gust.leadboat.com>
References: <20181231172922.GA199150@gust.leadboat.com>
Noah Misch <noah@leadboat.com> writes:
> When "make check TEMP_CONFIG=<(echo break_me=on)" spawns a postmaster that
> fails startup, we detect that with "pg_regress: postmaster did not respond
> within 60 seconds". pg_regress has a kill(postmaster_pid, 0) intended to
> detect this case faster. Since kill(ZOMBIE-PID, 0) succeeds[1], that test is
> ineffective.
Ooops.
> The fix, attached, is to instead test waitpid(), like pg_ctl's
> wait_for_postmaster() does.
+1. This leaves postmaster_pid as a dangling pointer, but since
we just exit immediately, that seems fine. (If we continued, and
arrived at the "kill(postmaster_pid, SIGKILL)" below, it would not
be fine.)
regards, tom lane
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-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, noah@leadboat.com
Subject: Re: pg_regress: promptly detect failed postmaster startup
In-Reply-To: <19454.1546282291@sss.pgh.pa.us>
* 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