Re: Restart pg_usleep when interrupted

From: Sami Imseih <samimseih(at)gmail(dot)com>
To: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>
Cc: Nathan Bossart <nathandbossart(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-10 00:01:55
Message-ID: 9D64CD7C-CA24-4FF4-9421-3A1A63F87DAC@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


>
> Yeah, I had the same thought in [1], so +1.
>
> [1]: https://www.postgresql.org/message-id/ZpDhS4nFX66ItAze%40ip-10-97-1-34.eu-west-3.compute.internal
>

The intention ( see start of the thread ) was to make this a general API,
but I was not sure if there are use cases outside of vacuum.c.

In v8, I moved the function to pgsleep.c/signals.c and called it pg_usleep_non_interruptible.
The function, unlike vacuum_sleep, will take in micros as an argument to match with pg_usleep.

Regards

Sami

Attachment Content-Type Size
v8-0001-vaccum_delay-with-absolute-time-nanosleep.patch application/octet-stream 4.3 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2024-08-10 01:29:51 Re: On non-Windows, hard depend on uselocale(3)
Previous Message Alvaro Herrera 2024-08-09 23:08:40 Re: libpq: Fix lots of discrepancies in PQtrace