pgsql: Make plpgsql_trap test more robust and less resource-intensive. - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Make plpgsql_trap test more robust and less resource-intensive.
Date
Msg-id E1wFCV3-0021O4-1p@gemulon.postgresql.org
Whole thread
List pgsql-committers
Make plpgsql_trap test more robust and less resource-intensive.

We were using "select count(*) into x from generate_series(1,
1_000_000_000_000)" to waste one second waiting for a statement
timeout trap.  Aside from consuming CPU to little purpose, this could
easily eat several hundred MB of temporary file space, which has been
observed to cause out-of-disk-space errors in the buildfarm.
Let's just use "pg_sleep(10)", which is far less resource-intensive.

Also update the "when others" exception handler so that if it does
ever again trap an error, it will tell us what error.  The cause of
these intermittent buildfarm failures had been obscure for awhile.

Discussion: https://postgr.es/m/557992.1776779694@sss.pgh.pa.us
Backpatch-through: 14

Branch
------
REL_16_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/5dbc5bb106c086b60617b7599deb9cd33bf20275

Modified Files
--------------
src/pl/plpgsql/src/expected/plpgsql_trap.out | 8 +++-----
src/pl/plpgsql/src/sql/plpgsql_trap.sql      | 6 ++----
2 files changed, 5 insertions(+), 9 deletions(-)


pgsql-committers by date:

Previous
From: Michael Paquier
Date:
Subject: pgsql: Fix a set of typos and grammar issues across the tree
Next
From: Tom Lane
Date:
Subject: pgsql: Remove gen_node_support.pl's ad-hoc ABI stability check.