agora inbox for pgsql-committers@postgresql.org
help / color / mirror / Atom feedFrom: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix injection point detach timing problem in TAP test for lock s
Date: Tue, 07 Apr 2026 04:19:40 +0000
Message-ID: <E1w9xud-003KrO-0e@gemulon.postgresql.org> (raw)
Fix injection point detach timing problem in TAP test for lock stats
injection_points_detach() could fail because of a concurrent cleanup
triggered by injection_points_set_local() when a session finishes.
This problem could be reproduced by adding a hardcoded sleep in
InjectionPointDetach(), and has been detected by the CI.
As the test is designed so as the injection point is detached before
being awaken, there is no need for it to be local, similarly to test
010_index_concurrently_upsert. This commit removes
injection_points_set_local(), replacing it with a confirmation that the
point has been attached in the session expected to block on a lock.
With this removal, the detach cannot happen concurrently anymore, only
before when the point is woken up.
Issue introduced by 557a9f1e3e62, where the test has been added.
Reported-by: Andres Freund <andres@anarazel.de>
Discussion: https://postgr.es/m/rp6wz4lnz5qn4zlh7uxtavzfrmqvycy2g42z4zasfss2gxi54f@zzcsjdvdflwp
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/3284e3f63cf0b42a1c89bb547778754d72aac9e4
Modified Files
--------------
src/test/modules/test_misc/t/011_lock_stats.pl | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
Message-ID: <E1w9xud-003KrO-0e@gemulon.postgresql.org>
Permalink: ../E1w9xud-003KrO-0e@gemulon.postgresql.org/
Also on: postgresql.org/message-id/E1w9xud-003KrO-0e@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 using the --to and --cc options:
reply via email
To: pgsql-committers@postgresql.org
Cc: michael@paquier.xyz, pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Fix injection point detach timing problem in TAP test for lock s
In-Reply-To: <E1w9xud-003KrO-0e@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 agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox