Re: add assertion for palloc in signal handlers - Mailing list pgsql-hackers

From Andres Freund
Subject Re: add assertion for palloc in signal handlers
Date
Msg-id x7dd2wksmkbwhkrarcux6kcyytlqilog563os444jxkao4jom3@uesjxkuavf7f
Whole thread
In response to Re: add assertion for palloc in signal handlers  (Heikki Linnakangas <hlinnaka@iki.fi>)
List pgsql-hackers
Hi,

On 2026-02-18 02:17:34 +0200, Heikki Linnakangas wrote:
> > I'd advocate for adding an InSpinlock or such at the same time, but admittedly
> > there's not really anything forcing that to happen together.
> 
> What would you do with the InSpinlock flag? Forbid palloc()'s etc. while
> holding a spinlock? I guess, although I'm not too worried about that.

Forbid other spinlocks, elog, palloc, lwlock, for starters. I've seen all of
those in patches in the last years.


> Spinlocks are not held for long.

That's what should be the case, yet we semi-regularly get patches that don't
follow that rule...

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: index prefetching
Next
From: Nisha Moond
Date:
Subject: Re: pgstat include expansion