Re: Avoid multiple SetLatch() calls in procsignal_sigusr1_handler()

From: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: Dilip Kumar <dilipbalaut(at)gmail(dot)com>, Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>, Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Avoid multiple SetLatch() calls in procsignal_sigusr1_handler()
Date: 2026-04-01 03:44:44
Message-ID: acyUrI2kV64lfOio@ip-10-97-1-34.eu-west-3.compute.internal
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On Wed, Apr 01, 2026 at 12:17:28PM +0900, Fujii Masao wrote:
> On Mon, Mar 30, 2026 at 1:21 PM Dilip Kumar <dilipbalaut(at)gmail(dot)com> wrote:
> > Shouldn't we add a comment to the handler function header stating that
> > SetLatch should be called by the caller? procsignal_sigusr1_handler()
> > is currently the only caller and handles it, but this would ensure any
> > future callers are responsible for the same.
>
> I *guess* the original comment was added because readers of the interrupt
> handling code might just wonder why SetLatch() isn't called. If so, it makes
> sense to keep that explanation in the handler functions themselves.
>
> The existing comment seems sufficient to me. The code isn't complicated enough
> to require more comment for future use of functions in advance, and we can
> revisit it if the functions change in the future. Based on this, I'm thinking
> to commit v2 patch.

That sounds reasonable to me to proceed as v2 is doing.

Regards,

--
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Chao Li 2026-04-01 03:45:08 Re: [oauth] Split and extend PGOAUTHDEBUG
Previous Message David Rowley 2026-04-01 03:35:14 Re: More speedups for tuple deformation