pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Remove race condition in 022_crash_temp_files.pl test.
Date: Wed, 06 Apr 2022 00:44:14 +0000
Message-ID: <E1nbtmQ-000VXg-61@gemulon.postgresql.org> (raw)

Remove race condition in 022_crash_temp_files.pl test.

It's possible for the query that "waits for restart" to complete a
successful iteration before the postmaster has noticed its SIGKILL'd
child and begun the restart cycle.  (This is a bit hard to believe
perhaps, but it's been seen at least twice in the buildfarm, mainly
on ancient platforms that likely have quirky schedulers.)

To provide a more secure interlock, wait for the other session
we're using to report that it's been forcibly shut down.

Patch by me, based on a suggestion from Andres Freund.
Back-patch to v14 where this test case came in.

Discussion: https://postgr.es/m/1801850.1649047827@sss.pgh.pa.us

Branch
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/9a7229948c70945ca6ef0b36adfe61b74f4fdaf5

Modified Files
--------------
src/test/recovery/t/022_crash_temp_files.pl | 34 ++++++++++++++++++++++++-----
1 file changed, 29 insertions(+), 5 deletions(-)



view thread (2+ messages)

Message-ID: <E1nbtmQ-000VXg-61@gemulon.postgresql.org>
Permalink:  ../E1nbtmQ-000VXg-61@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1nbtmQ-000VXg-61@gemulon.postgresql.org

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Remove race condition in 022_crash_temp_files.pl test.
  In-Reply-To: <E1nbtmQ-000VXg-61@gemulon.postgresql.org>
  References: <E1nbtmQ-000VXg-61@gemulon.postgresql.org>

* 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