Re: Use WaitLatch for {pre, post}_auth_delay instead of pg_usleep

From: "Bossart, Nathan" <bossartn(at)amazon(dot)com>
To: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>, "michael(at)paquier(dot)xyz" <michael(at)paquier(dot)xyz>
Cc: "tgl(at)sss(dot)pgh(dot)pa(dot)us" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "pryzby(at)telsasoft(dot)com" <pryzby(at)telsasoft(dot)com>, "bharath(dot)rupireddyforpostgres(at)gmail(dot)com" <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>, "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Use WaitLatch for {pre, post}_auth_delay instead of pg_usleep
Date: 2021-07-29 23:27:32
Message-ID: FCB485E0-ED3C-4345-A551-028321F3BA01@amazon.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 7/29/21, 12:59 AM, "Kyotaro Horiguchi" <horikyota(dot)ntt(at)gmail(dot)com> wrote:
> At Thu, 29 Jul 2021 09:52:08 +0900, Michael Paquier <michael(at)paquier(dot)xyz> wrote in
>> On Wed, Jul 28, 2021 at 08:28:12PM +0000, Bossart, Nathan wrote:
>> > On 7/28/21, 11:32 AM, "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> >> I follow the idea of using WaitLatch to ensure that the delays are
>> >> interruptible by postmaster signals, but even that isn't worth a
>> >> lot given the expected use of these things. I don't see a need to
>> >> expend any extra effort on wait-reporting.
>> >
>> > +1. The proposed patch doesn't make the delay visibility any worse
>> > than what's already there.
>>
>> Agreed to just drop the patch (my opinion about this patch is
>> unchanged). Not to mention that wait events are not available at SQL
>> level at this stage yet.
>
> I'm +1 to not adding wait event stuff at all. So the only advantage
> this patch would offer is interruptivity. I vote +-0.0 for adding that
> interruptivity (+1.0 from the previous opinion of mine:p).

I'm still in favor of moving to WaitLatch() for pre/post_auth_delay,
but I don't think we should worry about the wait reporting stuff. The
patch doesn't add a tremendous amount of complexity, it improves the
behavior on postmaster crashes, and it follows the best practice
described in pgsleep.c of using WaitLatch() for long sleeps.

Nathan

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bossart, Nathan 2021-07-29 23:37:56 Re: Slightly improve initdb --sync-only option's help message
Previous Message Alvaro Herrera 2021-07-29 23:26:46 Re: pg_upgrade does not upgrade pg_stat_statements properly