Re: BUG #18944: Assertion Failure in psql with idle_session_timeout Set

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: n(dot)kalinin(at)postgrespro(dot)ru, pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: Anthonin Bonnefoy <anthonin(dot)bonnefoy(at)datadoghq(dot)com>
Subject: Re: BUG #18944: Assertion Failure in psql with idle_session_timeout Set
Date: 2025-06-02 08:13:48
Message-ID: aD1dPMIZzAwMKm7G@paquier.xyz
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Mon, Jun 02, 2025 at 06:34:12AM +0000, PG Bug reporting form wrote:
> Hello! When I execute the following query:
> psql <<EOF
> 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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message vignesh C 2025-06-02 10:22:27 Re: Logical replication 'invalid memory alloc request size 1585837200' after upgrading to 17.5
Previous Message Duncan Sands 2025-06-02 07:12:50 Re: Logical replication 'invalid memory alloc request size 1585837200' after upgrading to 17.5