Re: Prevent an error on attaching/creating a DSM/DSA from an interrupt handler.

From: Daniel Gustafsson <daniel(at)yesql(dot)se>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, Rahila Syed <rahilasyed90(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>, Tomas Vondra <tomas(at)vondra(dot)me>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: Prevent an error on attaching/creating a DSM/DSA from an interrupt handler.
Date: 2025-05-19 21:52:52
Message-ID: 7DD69CE0-7EA3-4632-9BC3-BD788F1A986F@yesql.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On 1 May 2025, at 14:40, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:

> ..in general I'm
> skeptical that we can really set up something that is OK to do in an
> aborted transaction, because our ability to handle any further errors
> at that point is extremely limited, and this code is definitely
> complex enough that it could error out.

Rahila and I were talking about this last week at PGConf.dev and one safety
measure to implement here is to skip this processing for aborted transactions.
While there will be cases when debugging the memory of an aborted transaction
is of interest, we are as you say limited in what we can/should do in that case
so immediately returning is the safer option. The attached also encodes the
example from this thread as a test using an interactive background.

(The attached has a small context id fix as well but the interesting bit is the
above.)

--
Daniel Gustafsson

Attachment Content-Type Size
0001-Avoid-memory-context-reporting-in-aborted-transactio.patch application/octet-stream 5.2 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Nathan Bossart 2025-05-19 22:07:21 Re: Remove Instruction Synchronization Barrier in spin_delay() for ARM64 architecture
Previous Message Michael Paquier 2025-05-19 21:46:34 Re: Make wal_receiver_timeout configurable per subscription