Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vfiEg-004NcM-09 for pgsql-hackers@arkaria.postgresql.org; Tue, 13 Jan 2026 17:31:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vfiEf-005waV-13 for pgsql-hackers@arkaria.postgresql.org; Tue, 13 Jan 2026 17:31:17 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vfiEf-005waC-07 for pgsql-hackers@lists.postgresql.org; Tue, 13 Jan 2026 17:31:17 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vfiEJ-000EvR-1L for pgsql-hackers@postgresql.org; Tue, 13 Jan 2026 17:31:16 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 60DHUsbA4182253; Tue, 13 Jan 2026 12:30:54 -0500 From: Tom Lane To: Anthonin Bonnefoy cc: PostgreSQL Hackers Subject: Re: Stmt timeout error can be sent after a CommandComplete In-reply-to: References: Comments: In-reply-to Anthonin Bonnefoy message dated "Tue, 13 Jan 2026 10:20:32 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <4182251.1768325454.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Tue, 13 Jan 2026 12:30:54 -0500 Message-ID: <4182252.1768325454@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Anthonin Bonnefoy 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%3DJ= bGdTHuf8vQ%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