Use standard die() signal handler in walreceiver
authorHeikki Linnakangas <[email protected]>
Fri, 4 Apr 2025 09:31:00 +0000 (12:31 +0300)
committerHeikki Linnakangas <[email protected]>
Fri, 4 Apr 2025 09:38:32 +0000 (12:38 +0300)
commit6e9c81836e101bc7f37ddc5e2f6ab58d62efcb24
treeb0c6e5c4cf53c29e34df1e8589aa5c829b74d737
parent8123e91f5aeb26c6e4cf583bb61c99281485af83
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]>
src/backend/replication/libpqwalreceiver/libpqwalreceiver.c
src/backend/replication/walreceiver.c
src/backend/tcop/postgres.c
src/include/replication/walreceiver.h