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.94.2) (envelope-from ) id 1uM0J2-000FtT-NY for pgsql-bugs@arkaria.postgresql.org; Mon, 02 Jun 2025 08:14:05 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1uM0J0-008Zei-6Q for pgsql-bugs@arkaria.postgresql.org; Mon, 02 Jun 2025 08:14:02 +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.94.2) (envelope-from ) id 1uM0Iz-008Zea-LS for pgsql-bugs@lists.postgresql.org; Mon, 02 Jun 2025 08:14:01 +0000 Received: from fout-a3-smtp.messagingengine.com ([103.168.172.146]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1uM0Ix-001A1O-1k for pgsql-bugs@lists.postgresql.org; Mon, 02 Jun 2025 08:14:00 +0000 Received: from phl-compute-03.internal (phl-compute-03.phl.internal [10.202.2.43]) by mailfout.phl.internal (Postfix) with ESMTP id 16E091380317; Mon, 2 Jun 2025 04:13:58 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-03.internal (MEProxy); Mon, 02 Jun 2025 04:13:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm1; t=1748852038; x=1748938438; bh=5u/o2cfjls jqZVxad26yMTEekYP/mdOfmnB0mVoiVhg=; b=nADcZ/TsbQFiDihfp/fSlHL+cq VRKAz3l3r3lQCmPEKo3C0MiF83VkeQrFyb2wwkKFhptQ7df+kmA9dXEaJ23AzPfD uS50fb971JMxYO3wWTTiLIL5CQ+sdPIPdPFwe5Fk6G9ZeF/H2sCNkH53M/NozbfV vwY2VO0cksZT4KUe4ld+nJjSmwF85LcS+ugiRCNgPoVEEOwIp3scNF7BJ9kkk8J5 lvfTfZwzeRD8K9PmIftRkJlX1/DJZviBD07Jg05toBW2QlneHFsoRSwksdlwwUXb XWe6jV51PpJUgW73esq7I/EvkmWdJRTTNio4yJar4zYsPDoJVHpJTTwWvJ/w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1748852038; x=1748938438; bh=5u/o2cfjlsjqZVxad26yMTEekYP/mdOfmnB 0mVoiVhg=; b=SAw1cJ1VX/ORH6+n5PXNQs8V/9MX7+EpFw8G8ZCFvp6Vx0JP907 yX2wYuCaRaUCcunf7bUJEeIYcav0yZqZuHX5j+k+3pg+3XKpfkCQGN1NUz8IfziD 1W2sTwpXtIgP/PpmQFiJyeoMMlca+0jnvN91E/I3reTBG47xNmz/3pPcSMBKkjpi RZnn2FJ0PxGzJ86mhPFNVw64Ma8w+ieptZNYpq4M4xsQI8W9uDk/6wB6eN9DIVrm q3eHbkKIMUHiKbluXRRLVKo1VFlXGbI2ehmuA4QxX2FHcgK3KK5ZeTWtBMv0Kq/t DEp+aKqhk5DZuVopkUkbmZxm5XKWSXf0GyA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtddtgdefjeduieculddtuddrgeefvddrtd dtmdcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggft fghnshhusghstghrihgsvgdpuffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftd dtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfghrlhcuvffnffculdejtddm necujfgurhepfffhvfevuffkfhggtggujgesghdtreertddtvdenucfhrhhomhepofhitg hhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprghquhhivghrrdighiiiqeen ucggtffrrghtthgvrhhnpeetleeifedufffhhfdtteelgeeggeffhfekueevteeigfduud evudetgfegiedvjeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhl fhhrohhmpehmihgthhgrvghlsehprghquhhivghrrdighiiipdhnsggprhgtphhtthhope efpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehnrdhkrghlihhnihhnsehpohhs thhgrhgvshhprhhordhruhdprhgtphhtthhopehpghhsqhhlqdgsuhhgsheslhhishhtsh drphhoshhtghhrvghsqhhlrdhorhhgpdhrtghpthhtoheprghnthhhohhnihhnrdgsohhn nhgvfhhohiesuggrthgrughoghhhqhdrtghomh X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 2 Jun 2025 04:13:55 -0400 (EDT) Date: Mon, 2 Jun 2025 17:13:48 +0900 From: Michael Paquier To: n.kalinin@postgrespro.ru, pgsql-bugs@lists.postgresql.org Cc: Anthonin Bonnefoy Subject: Re: BUG #18944: Assertion Failure in psql with idle_session_timeout Set Message-ID: References: <18944-8a926c30f68387dd@postgresql.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="WvY28HPqSx7eRfC+" Content-Disposition: inline In-Reply-To: <18944-8a926c30f68387dd@postgresql.org> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --WvY28HPqSx7eRfC+ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Jun 02, 2025 at 06:34:12AM +0000, PG Bug reporting form wrote: > Hello! When I execute the following query: > psql < CREATE TABLE psql_pipeline(a INTEGER PRIMARY KEY, s TEXT); > \startpipeline > COPY psql_pipeline FROM STDIN; > \syncpipeline > \endpipeline > EOF > with `idle_session_timeout` set to, for example, 10000, I get the following > error: > FATAL: terminating connection due to idle-session timeout > psql: common.c:1501: discardAbortedPipelineResults: Assertion > `pset.available_results > 0' failed. Reproduced here, thanks for the report. In this case, we are in a PGRES_FATAL_ERROR state due to the timeout triggered by the backend, and the loop discarding the results in discardAbortedPipelineResults() does not take into account this case scenario: we don't have a result to process yet, think that there is one, and kaboom. It seems to me that we should just add an extra case for the result = NULL case as there is nothing pending. A FATAL means that we need to give up anyway. Anthonin, what do you think? -- Michael --WvY28HPqSx7eRfC+ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmg9XTwACgkQnvQgOdby QH3dCxAAqmhxQ6+OH3QkYNqsQk8vhZe86FIPv+CWyDdqBfuiUvoADnp3b5HLMhdF r2SN6hWUaBivkHI4U1c6e4SRlj922HiqyhrvWxSkLZMQhVJNsk7i0y7Cp2kcnz9l l3dwqEqC2jGOVQdwVTHZXKgFKfd5Bhxi3M5yR8Pssf0FKSuWP5ZPYJXgFDNspNXs DO7g3BKp8E8DuA6HG9K9VeCmh7J0nG0+lsSZ2CJ5lBXXXaQeViXlm2jCbyxVxJbU 8x4r/IfiE4yFt0uY8jAoM9M8yAg0ZdmMr04FHyRr6ZkVakJZouVc8INhHqKisvPd JWKCfJrOA4ob5MWmPs1Ppt4eGUSOWYyp+ii5smQ8ElComRXxBFndZ+elQIeHhpjE OHIqnrfm8wCaEIoO5+9z5E2DYPAPFhUP1G6cwD0FAUvHfb3BwfYyrxextE4Zb2KR I5WYpCpjVl/vySBk9t1bPKIH8z4BcRhqMuB6hOHEFPXWWH4FwcMo4u+ENqx0GPfk N+bpDGltY/i9U50VyuOgICOThwkbw0+NRATYvUbU+mh6QO9zHylGfyU/YEr+VZjm 1J4MTadTamZyGua0AXroN6gptMrx9nXHmWr1sHUK5cQkgtmej+LaI/Vs6E6+g+H6 hGVq4r1kU8jz1VcrKu21hyOrXPP2fkLoRA9nTvbNf6YjG1MCKf0= =hG/j -----END PGP SIGNATURE----- --WvY28HPqSx7eRfC+--