Re: injection_points: canceled or terminated waiters leak their wait slots

From: Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: injection_points: canceled or terminated waiters leak their wait slots
Date: 2026-07-22 06:07:01
Message-ID: CAN4CZFM5KGB0tuw8LA9jtbDzsf1qa+UxSzYUuCUJuB12ym6DHw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> I think that I'd rather use a PG_TRY/PG_FINALLY and avoid the
> refactoring with the extra routine required, keeping the cleanup
> action local to injection_wait()

Wouldn't that miss FATAL? (pg_terminate_backend in the testcase)

> Thanks for that. I'm always OK to deal with a backpatch as required.
> Posting versions saves some time, of course, just don't feel obliged
> if you feel that this is extra work on your side.

I don't always consistently do this (sometimes it's interesting to
check that its different in back branches, sometimes I completely
forgot about it)

In this case, I started the testing / debugging on pg19, and only
checked that the code is different on master after I already had the
fix. Verifying that the code is the same on earlier branches wasn't
much extra work after that.

> Another thought: the addition of a SQL
> function that provides the list of waiters that we reuse here.

I can implement that if you think it is better, my initial logic was
to keep the fix smaller and strictly a bugfix.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kirill Reshke 2026-07-22 06:07:43 Re: Streaming replication and WAL archive interactions
Previous Message Ajin Cherian 2026-07-22 05:54:00 Re: [PATCH] Preserve replication origin OIDs in pg_upgrade