Re: pg_regress: promptly detect failed postmaster startup

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Noah Misch <noah(at)leadboat(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: pg_regress: promptly detect failed postmaster startup
Date: 2018-12-31 18:51:31
Message-ID: 19454.1546282291@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Noah Misch <noah(at)leadboat(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2018-12-31 19:36:35 Re: Unified logging system for command-line programs
Previous Message Andrew Gierth 2018-12-31 18:22:02 Re: Is MinMaxExpr really leakproof?