Re: [PATCH] Fix premature timeout in pg_promote() caused by signal interruptions - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: [PATCH] Fix premature timeout in pg_promote() caused by signal interruptions
Date
Msg-id acNIQaeIg88xkCNC@paquier.xyz
Whole thread Raw
In response to [PATCH] Fix premature timeout in pg_promote() caused by signal interruptions  (Robert Pang <robertpang@google.com>)
Responses Re: [PATCH] Fix premature timeout in pg_promote() caused by signal interruptions
List pgsql-hackers
On Wed, Mar 11, 2026 at 09:44:07AM -0700, Robert Pang wrote:
> The current implementation of pg_promote() calculates a fixed number
> of loop iterations based on the timeout value, assuming each loop
> waits exactly 100 ms for the backend latch. However, if the backend
> receives an unrelated signal (e.g., from
> client_connection_check_interval), it wakes up early. These repeated,
> unrelated wakeups cause the loop counter to deplete much faster than
> intended, leading to a premature timeout.

It is true that we can do better here, and your proposal about having
a more precise timeout calculation looks like a sensible improvement
for this case.

No objections regarding your patch.  I would like to apply it on HEAD,
if there are no objections.
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Teach isolation tester about injection points in background workers
Next
From: Michael Paquier
Date:
Subject: Re: Instability in test/regress/sql/portals.sql