Re: Stmt timeout error can be sent after a CommandComplete

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Anthonin Bonnefoy <anthonin(dot)bonnefoy(at)datadoghq(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Stmt timeout error can be sent after a CommandComplete
Date: 2026-01-13 17:30:54
Message-ID: 4182252.1768325454@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Anthonin Bonnefoy <anthonin(dot)bonnefoy(at)datadoghq(dot)com> writes:
> At the end of a command, disable_statement_timeout is called as the
> timeout applies to a specific command and a CommandComplete message is
> sent.
> However, it's possible for the stmt timeout to have been fired between
> the last message and the call to disable_statement_timeout. The
> timeout won't be active anymore, so disable_timeout will be skipped.
> However, the timeout is still queued, and the next call to
> CHECK_FOR_INTERRUPTS will process and generate a stmt timeout error.

I think this overlaps the discussion we're having over here:

https://www.postgresql.org/message-id/flat/CAGECzQQD5f9ce-D1v6vCTT94hG%3DJbGdTHuf8vQ%3DHBLz9T4dA1g%40mail.gmail.com

I agree that this area is a bit buggy, but I think it's got more
problems than just this.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2026-01-13 18:03:15 Re: CREATE TABLE LIKE INCLUDING TRIGGERS
Previous Message Álvaro Herrera 2026-01-13 17:30:27 Re: using index to speedup add not null constraints to a table