Re: Restart pg_usleep when interrupted

From: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
To: Nathan Bossart <nathandbossart(at)gmail(dot)com>
Cc: "Imseih (AWS), Sami" <samimseih(at)gmail(dot)com>, Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Restart pg_usleep when interrupted
Date: 2024-08-17 23:27:36
Message-ID: CA+hUKGKpo3fM=rnfdxHqt+jNGh_zUNcL1ob4hMsb=jFfKn9Aag@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Aug 18, 2024 at 11:12 AM Thomas Munro <thomas(dot)munro(at)gmail(dot)com> wrote:
> I guess both of these issues go away in practice if
> CF #5118 goes in.

To be more precise, if you just keep doing pg_usleep() the issue goes
away, and likewise for posix_fallocate() it goes away... But if you
switch to WaitLatchUs() so you can handle latch wakeups in vacuum
delays, which really you should because the latch might be an urgent
request for you to CHECK_FOR_INTERRUPTS(), because another backend is
waiting for all backends to service a ProcSignalBarrier (we need a new
name for that), well now you'll get wakeups, so you're back to square
one if someone is sending them very fast.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexander Lakhin 2024-08-18 03:00:00 Re: Remove dependence on integer wrapping
Previous Message Thomas Munro 2024-08-17 23:12:22 Re: Restart pg_usleep when interrupted