Re: add assertion for palloc in signal handlers

From: Andres Freund <andres(at)anarazel(dot)de>
To: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
Cc: Nathan Bossart <nathandbossart(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: add assertion for palloc in signal handlers
Date: 2026-02-18 04:25:25
Message-ID: x7dd2wksmkbwhkrarcux6kcyytlqilog563os444jxkao4jom3@uesjxkuavf7f
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Nisha Moond 2026-02-18 04:39:03 Re: pgstat include expansion
Previous Message Andres Freund 2026-02-18 04:21:28 Re: index prefetching