Re: Spinlock can be released twice in procsignal.c

2025-02-26 Thread Maxim Orlov
Great! Looks very good. Thanks a lot! -- Best regards, Maxim Orlov.

Re: Spinlock can be released twice in procsignal.c

2025-02-26 Thread Michael Paquier
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 lo

Re: Spinlock can be released twice in procsignal.c

2025-02-26 Thread Maxim Orlov
On Wed, 26 Feb 2025 at 11:26, Andrey Borodin wrote: > > I’d suggest to give some more descriptive name to “logit” and expand > comment “/* sanity check */“. This comment was easier to understand when > elog() was near, but now IMO we can have few words about what is going on. Done. Except for a

Re: Spinlock can be released twice in procsignal.c

2025-02-26 Thread Andrey Borodin
Michael, thanks a lot for the detailed explanation. > On 26 Feb 2025, at 11:57, Maxim Orlov wrote: > > Indeed. PFA the correct one. > > I’d suggest to give some more descriptive name to “logit” and expand comment “/* sanity check */“. This comment was easier to understand when elog() was ne

Re: Spinlock can be released twice in procsignal.c

2025-02-25 Thread Maxim Orlov
On Wed, 26 Feb 2025 at 07:56, Michael Paquier wrote: > > This fix is not correct. No system function calls (well basically > most of them) or even more no PostgreSQL-specific calls should happen > while holding a spinlock. elog() is a good example of what not to do. > One example: imagine a pal

Re: Spinlock can be released twice in procsignal.c

2025-02-25 Thread Michael Paquier
On Wed, Feb 26, 2025 at 09:08:53AM +0500, Andrey Borodin wrote: > Looks like the oversight in 9d9b9d4. IMO the fix is correct. if (pg_atomic_read_u32(&slot->pss_pid) != 0) { - SpinLockRelease(&slot->pss_mutex); elog(LOG, "process %d taking over ProcSig

Re: Spinlock can be released twice in procsignal.c

2025-02-25 Thread Andrey Borodin
> On 26 Feb 2025, at 00:34, Maksim.Melnikov wrote: > > In applied patch I removed spinlock release in if clause. Looks like the oversight in 9d9b9d4. IMO the fix is correct. Best regards, Andrey Borodin.

Spinlock can be released twice in procsignal.c

2025-02-25 Thread Maksim.Melnikov
. In applied patch I removed spinlock release in if clause. From ece7b5d6bf16111ad388fcb47ed9fd7572ef151e Mon Sep 17 00:00:00 2001 From: Maksim Melnikov Date: Tue, 25 Feb 2025 22:22:36 +0300 Subject: [PATCH] Spinlock can be released twice in procsignal.c --- src/backend/storage/ipc/procsignal.c | 1 - 1 file changed,