Re: Injection point: fix race condition between attach and cleanup

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
Cc: "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>, "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Alexander Lakhin <exclusion(at)gmail(dot)com>
Subject: Re: Injection point: fix race condition between attach and cleanup
Date: 2026-11-20 00:41:40
Message-ID: av-XRNWSUa1Frl6Y@paquier.xyz
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Nov 18, 2026 at 04:33:12PM -0800, Masahiko Sawada wrote:
> Alternative idea would be to pass an optional bool to
> BackgroundPsql.quit so that it quits the session and waits for the
> corresponding backend to exit too. I think that would be enough for
> 010_index_concurrently_upsert. It's close to the alternative patch
> Kuroda-san posted, in a reusable form. We can use it also in
> 051_effective_wal_level.pl.

I suspect that just offering this guarantee by default would have more
value in the long-run for the whole testing infrastructure. We have
also tests that depend on the timing where the shmem exit callbacks
are called, and backends could be reported as exited back to the
client before they have actually plugged off from the server and run
all the exit/cleanup code...
--
Michael

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2026-11-20 00:46:01 Parallel GIN, BRIN builds fail to maintain ii_BrokenHotChain
Previous Message Michael Paquier 2026-11-20 00:37:57 Re: pg_regress: schedule multi-line test groups