pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Nathan Bossart <nathan@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: test_dsa: Avoid leaking LWLock tranches.
Date: Wed, 12 Nov 2025 20:58:28 +0000
Message-ID: <E1vJHvA-006IGz-1Y@gemulon.postgresql.org> (raw)

test_dsa: Avoid leaking LWLock tranches.

Since this is a test module, leaking a couple of LWLock tranches is
fine, but we want to discourage that pattern in third-party code.
This commit teaches the module to create only one tranche and to
store its ID in shared memory for use by other backends.

Reported-by: Alexander Lakhin <exclusion@gmail.com>
Reviewed-by: Sami Imseih <samimseih@gmail.com>
Discussion: https://postgr.es/m/dd36d384-55df-4fc2-825c-5bc56c950fa9%40gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/c5c74282f2ea222beb7e07fc91b7afd7a06020c2

Modified Files
--------------
src/test/modules/test_dsa/test_dsa.c | 27 +++++++++++++++++++--------
1 file changed, 19 insertions(+), 8 deletions(-)



Message-ID: <E1vJHvA-006IGz-1Y@gemulon.postgresql.org>
Permalink:  ../E1vJHvA-006IGz-1Y@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1vJHvA-006IGz-1Y@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: nathan@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: test_dsa: Avoid leaking LWLock tranches.
  In-Reply-To: <E1vJHvA-006IGz-1Y@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