Use standard die() signal handler in walreceiver

This gets rid of the bespoken ProcessWalRcvInterrupts() function,
which lets walreceiver terminate at any CHECK_FOR_INTERRUPTS() call.
And it's less code anyway.

We can now use the standard libpqsrv_connect_params() libpq wrapper
from libpq-be-fe-helpers.h, removing more code. We attempted to do
that earlier already in commit 728f86fec6, but that was reverted
because it didn't call ProcessWalRcvInterrupts() and therefore didn't
react to shutdown requests. Now that ProcessWalRcvInterrupts() is
gone, it works. As stated in that commit, this also leads to
libpqwalreceiver reserving file descriptors for libpq conncetions,
which is nice.

Author: Andres Freund <[email protected]> (the earlier commit)
Author: Kyotaro Horiguchi <[email protected]>
Reviewed-by: Fujii Masao <[email protected]>
Reviewed-by: Yura Sokolov <[email protected]>

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/6e9c81836e101bc7f37ddc5e2f6ab58d62efcb24

Modified Files
--------------
.../libpqwalreceiver/libpqwalreceiver.c            | 208 +++++----------------
src/backend/replication/walreceiver.c              |  41 +---
src/backend/tcop/postgres.c                        |   4 +
src/include/replication/walreceiver.h              |   1 -
4 files changed, 51 insertions(+), 203 deletions(-)

Reply via email to