Re: Always show correct error message for statement timeouts, fixes random buildfarm failures

Jelte Fennema <postgres@jeltef.nl>

From: "Jelte Fennema-Nio" <postgres@jeltef.nl>
To: "Anthonin Bonnefoy" <anthonin.bonnefoy@datadoghq.com>, "Japin Li" <japinli@hotmail.com>
Cc: "Tom Lane" <tgl@sss.pgh.pa.us>, "Akshat Jaimini" <destrex271@gmail.com>, <pgsql-hackers@lists.postgresql.org>
Date: 2026-01-14T11:25:14Z
Lists: pgsql-hackers

Attachments

On Wed Jan 14, 2026 at 11:42 AM CET, Anthonin Bonnefoy wrote:
> I've encountered a related issue which is fixed by Jelte's patch. 

Great that it fixes that too.

> The comment feels a bit misleading. 

Updated the comment now (I had copied it verbatim from its original
location, but I agree it didn't describe the new behaviour clearly).

> Is it still possible to have both the statement timeout active and
> fired? You added the change to enable_statement_timeout to avoid
> restarting it when it was already triggered, so I would expect an
> active timeout to not have the indicator flag set. I guess there's the
> possible race where the timeout is triggered between
> get_timeout_active and disable_timeout.

Updated that comment to make it clear that it's indeed there for that rare
race condition.