Re: enable_timeout_every() and fin_time - Mailing list pgsql-hackers

From Robert Haas
Subject Re: enable_timeout_every() and fin_time
Date
Msg-id CA+TgmobXKreG8=aTmW7bPKk4V=dcS3kFYXLhY_QHMzpNkKPO1w@mail.gmail.com
Whole thread Raw
In response to enable_timeout_every() and fin_time  (Andres Freund <andres@anarazel.de>)
Responses Re: enable_timeout_every() and fin_time
List pgsql-hackers
On Sun, Jan 1, 2023 at 7:36 PM Andres Freund <andres@anarazel.de> wrote:
> What is the use case for an absolute start time plus a relative
> interval?

The code snippet that you indicate has the important side effect of
changing the global variable startup_progress_phase_start_time, which
is used by has_startup_progress_timeout_expired. Without the fin_time
argument, the timeout machinery would have to call
GetCurrentTimestamp() separately, and the caller wouldn't know what
answer it got. The result would be that the progress reports would
indicate an elapsed time relative to one timestamp, but the time at
which those progress reports were printed would be relative to a
slightly different timestamp.

Maybe nobody would notice such a minor discrepancy, but I wanted to avoid it.

-- 
Robert Haas
EDB: http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: Nathan Bossart
Date:
Subject: Re: Simplify standby state machine a bit in WaitForWALToBecomeAvailable()
Next
From: Garen Torikian
Date:
Subject: Re: [PATCH] Expand character set for ltree labels