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

From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Bertrand Drouvot <bertranddrouvot(dot)pg(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-02 14:57:50
Message-ID: CAHGQGwFg-2LYk-=m0R7Z5wnm_j9MH-=NK2P++LgPUvoFU6SNJQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Apr 1, 2026 at 12:44 PM Bertrand Drouvot
<bertranddrouvot(dot)pg(at)gmail(dot)com> wrote:
>
> 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.

Thanks! I've pushed the patch.

Regards,

--
Fujii Masao

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tomas Vondra 2026-04-02 15:05:34 Re: EXPLAIN: showing ReadStream / prefetch stats
Previous Message Laurenz Albe 2026-04-02 14:55:02 Re: Add ldapservice connection parameter