From: | Michael Paquier <michael(at)paquier(dot)xyz> |
---|---|
To: | Anthonin Bonnefoy <anthonin(dot)bonnefoy(at)datadoghq(dot)com> |
Cc: | n(dot)kalinin(at)postgrespro(dot)ru, pgsql-bugs(at)lists(dot)postgresql(dot)org |
Subject: | Re: BUG #18944: Assertion Failure in psql with idle_session_timeout Set |
Date: | 2025-06-04 00:12:17 |
Message-ID: | aD-PYXOv643xVcOf@paquier.xyz |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-bugs |
On Tue, Jun 03, 2025 at 11:56:51AM +0200, Anthonin Bonnefoy wrote:
> I've tried to adjust the piped syncs counter, but that's not enough.
> libpq's internal command queue still has the Syncs queued and will
> stay in a busy pipeline state if the backend doesn't send the expected
> ReadyForQuery. It could be possible to remove them from the queue with
> pqCommandQueueAdvance, but that would require psql to include
> libpq-int.h which is probably something we want to avoid.
libpq-int.h is for internal purposes and should not be directly
used in frontends, so that's a no-go.
> It doesn't seem like this case can be handled gracefully. The provided
> patch just aborts the connection from the frontend when excessive
> piped syncs are detected to avoid staying stuck in this inconsistent
> protocol state.
I have been spending some time trying to get psql to gracefully handle
this case, likely as you did by making ExecQueryAndProcessResults()
fail gracefully, but even reinitializing the counters is not enough
and I have also bumped into the libpq limitations. If somebody is
excited enough to justify exposing these APIs, perhaps they'll have a
good reason and a case to do so, but I'm not excited about doing that
for this psql tooling: we are still able to serialize commands within
a pipeline anyway.
For now I have applied your patch, adding one extra test with COPY TO
on top of the one with COPY FROM.
--
Michael
From | Date | Subject | |
---|---|---|---|
Next Message | Michael Paquier | 2025-06-04 00:44:03 | Re: BUG #18920: LOAD '$libdir/plugins' no longer works in 18beta1 |
Previous Message | Masahiko Sawada | 2025-06-03 19:43:50 | Re: Logical replication 'invalid memory alloc request size 1585837200' after upgrading to 17.5 |