]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Add helper library for use of libpq inside the server environment
authorAndres Freund <andres@anarazel.de>
Tue, 24 Jan 2023 03:25:23 +0000 (19:25 -0800)
committerNoah Misch <noah@leadboat.com>
Thu, 3 Apr 2025 16:34:01 +0000 (09:34 -0700)
commit9e129a2243e2c1e5b7107cec06262aad26533f0c
tree0ed73f32efe5dfcf010b37f7244f6acccd03f80d
parentd8aa826207ef178aa82804eda45013f2e0f15935
Add helper library for use of libpq inside the server environment

Currently dblink and postgres_fdw don't process interrupts during connection
establishment. Besides preventing query cancellations etc, this can lead to
undetected deadlocks, as global barriers are not processed.

Libpqwalreceiver in contrast, processes interrupts during connection
establishment. The required code is not trivial, so duplicating it into
additional places does not seem like a good option.

These aforementioned undetected deadlocks are the reason for the spate of CI
test failures in the FreeBSD 'test_running' step.

For now the helper library is just a header, as it needs to be linked into
each extension using libpq, and it seems too small to be worth adding a
dedicated static library for.

The conversion to the helper are done in subsequent commits.

Reviewed-by: Thomas Munro <thomas.munro@gmail.com>
Discussion: https://postgr.es/m/20220925232237.p6uskba2dw6fnwj2@awork3.anarazel.de
src/include/libpq/libpq-be-fe-helpers.h [new file with mode: 0644]