Re: Spinlock can be released twice in procsignal.c

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Maxim Orlov <orlovmg(at)gmail(dot)com>
Cc: Andrey Borodin <x4mmm(at)yandex-team(dot)ru>, "Maksim(dot)Melnikov" <m(dot)melnikov(at)postgrespro(dot)ru>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, Jelte Fennema-Nio <postgres(at)jeltef(dot)nl>
Subject: Re: Spinlock can be released twice in procsignal.c
Date: 2025-02-27 00:46:49
Message-ID: Z7-1-d3ZQs4QZgSk@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Feb 26, 2025 at 12:33:16PM +0300, Maxim Orlov wrote:
> Done. Except for a new name for "logit" variable. Unfortunately, I can't
> think of anything sane. As an example I looked at sequence.c. The same name
> is used there. I will gladly change this name to whatever you want if it
> still look misleading or incomplete for you in some way or another. Just
> write the name that you think is correct.

"old_pss_pid", because this is an old pss_pid value from a previous
slot. Keeping the value around after releasing the slot is also
useful for debugging, so rather than a boolean it is possible to use a
uint32. The "sanity check" comment was also a bit out-of-order
because it was written just before acquiring the spinlock.

Tweaked a bit the whole, and the result looked OK so applied on HEAD.
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2025-02-27 01:39:04 Re: Anti join confusion
Previous Message Jeff Davis 2025-02-27 00:08:59 Re: Proposal: "query_work_mem" GUC, to distribute working memory to the query's individual operators