public inbox for [email protected]
help / color / mirror / Atom feedFrom: Fujii Masao <[email protected]>
To: Robert Haas <[email protected]>
Cc: Fujii Masao <[email protected]>
Cc: PostgreSQL Hackers <[email protected]>
Subject: Re: pgsql: Add function to log the memory contexts of specified backend pro
Date: Fri, 2 May 2025 02:27:54 +0900
Message-ID: <[email protected]> (raw)
In-Reply-To: <CA+TgmoZfVES0SaS3NpP1kf__fW1ODc_wzVaNNC9HBHvERvh9xA@mail.gmail.com>
References: <[email protected]>
<CA+TgmoZMrv32tbNRrFTvF9iWLnTGqbhYSLVcrHGuwZvCtph0NA@mail.gmail.com>
<[email protected]>
<CA+TgmoZfVES0SaS3NpP1kf__fW1ODc_wzVaNNC9HBHvERvh9xA@mail.gmail.com>
On 2025/05/01 21:42, Robert Haas wrote:
> On Thu, May 1, 2025 at 3:53 AM Fujii Masao <[email protected]> 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
view thread (2+ messages)
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected], [email protected]
Subject: Re: pgsql: Add function to log the memory contexts of specified backend pro
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox