pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix leaked hash scans in pg_listening_channels().
2+ messages / 1 participants
[nested] [flat]

* pgsql: Fix leaked hash scans in pg_listening_channels().
@ 2026-10-25 19:14  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2026-10-25 19:14 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix leaked hash scans in pg_listening_channels().

Commit 282b1cde9 changed pg_listening_channels() to keep a hash table
scan open between calls of this set-returning function.  If the
executor stops fetching rows early, as with a target-list call under
LIMIT, the scan remains registered until transaction end, resulting in
leak complaints and eventually a PANIC.

Instead materialize the result in a tuplestore, so that we can
complete the hash scan within a single call.

Author: Joel Jacobson <joel@compiler.org>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/069fc976-bee1-4f0f-b22b-86ef7ed4f9ff@app.fastmail.com
Backpatch-through: 19

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/dfd7ede529f288639760444a9c69f3f7bb65450c

Modified Files
--------------
src/backend/commands/async.c        | 56 ++++++++++++++-----------------------
src/test/regress/expected/async.out |  7 +++++
src/test/regress/sql/async.sql      |  4 +++
3 files changed, 32 insertions(+), 35 deletions(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* pgsql: Fix leaked hash scans in pg_listening_channels().
@ 2026-10-25 19:14  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2026-10-25 19:14 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix leaked hash scans in pg_listening_channels().

Commit 282b1cde9 changed pg_listening_channels() to keep a hash table
scan open between calls of this set-returning function.  If the
executor stops fetching rows early, as with a target-list call under
LIMIT, the scan remains registered until transaction end, resulting in
leak complaints and eventually a PANIC.

Instead materialize the result in a tuplestore, so that we can
complete the hash scan within a single call.

Author: Joel Jacobson <joel@compiler.org>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/069fc976-bee1-4f0f-b22b-86ef7ed4f9ff@app.fastmail.com
Backpatch-through: 19

Branch
------
REL_19_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/2b491ff1cd2e23ac7a9f9efbd59ddd4aa02dbb58

Modified Files
--------------
src/backend/commands/async.c        | 56 ++++++++++++++-----------------------
src/test/regress/expected/async.out |  7 +++++
src/test/regress/sql/async.sql      |  4 +++
3 files changed, 32 insertions(+), 35 deletions(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2026-10-25 19:14 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-10-25 19:14 pgsql: Fix leaked hash scans in pg_listening_channels(). Tom Lane <tgl@sss.pgh.pa.us>
2026-10-25 19:14 pgsql: Fix leaked hash scans in pg_listening_channels(). Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox