Re: pgsql: Add function to log the memory contexts of specified backend pro

From: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Fujii Masao <fujii(at)postgresql(dot)org>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: pgsql: Add function to log the memory contexts of specified backend pro
Date: 2025-05-01 17:27:54
Message-ID: b636ab38-8c55-4deb-a621-8651dcab4ced@oss.nttdata.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On 2025/05/01 21:42, Robert Haas wrote:
> On Thu, May 1, 2025 at 3:53 AM Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com> wrote:
>> Just idea, what do you think about adding a flag to indicate whether
>> ProcessLogMemoryContextInterrupt() is currently running? Then,
>> when a backend receives a signal and ProcessLogMemoryContextInterrupt()
>> is invoked, it can simply return immediately if the flag is already set
>> like this:
>
> I think that something like this could work, but you would need more
> than this. Otherwise, if the function errors out, the flag would
> remain permanently set.

Yes, we need to either use PG_TRY()/PG_FINALLY() or handle the flag as
a global variable and reset it in the error handling path. I think using
PG_TRY()/PG_FINALLY() is the simpler option.

Regards,

--
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Jacob Champion 2025-05-01 17:41:49 Re: pgsql: oauth: Move the builtin flow into a separate module
Previous Message Jacob Champion 2025-05-01 17:25:58 pgsql: oauth: Move the builtin flow into a separate module

Browse pgsql-hackers by date

  From Date Subject
Next Message Jacob Champion 2025-05-01 17:38:15 Re: [PoC] Federated Authn/z with OAUTHBEARER
Previous Message Andrei Lepikhov 2025-05-01 17:22:20 Re: Some problems regarding the self-join elimination code