pgsql: Use proc_exit() for walreceiver exit in WalRcvWaitForStartPositi

From: Fujii Masao <fujii(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Use proc_exit() for walreceiver exit in WalRcvWaitForStartPositi
Date: 2026-04-16 03:33:59
Message-ID: E1wDDUN-001Bcp-0G@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Use proc_exit() for walreceiver exit in WalRcvWaitForStartPosition()

Previously, when the walreceiver exited from WalRcvWaitForStartPosition()
at the startup process's request, it called exit(1) directly. This could
skip cleanup performed by the callback functions.

This commit makes the walreceiver to use proc_exit() instead, ensuring
normal cleanup is executed on exit.

Also this commit updates comments describing walreceiver termination.

Apply to master only, as this has not caused practical issues so far.

Author: Chao Li <lic(at)highgo(dot)com>
Reviewed-by: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Reviewed-by: Andreas Karlsson <andreas(at)proxel(dot)se>
Reviewed-by: Xuneng Zhou <xunengzhou(at)gmail(dot)com>
Discussion: https://postgr.es/m/74381238-4E8A-4621-B794-57025DCCE0BA@gmail.com

Branch
------
master

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

Modified Files
--------------
src/backend/replication/walreceiver.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Fujii Masao 2026-04-16 03:49:58 Re: pgsql: ssl: Serverside SNI support for libpq
Previous Message Bruce Momjian 2026-04-15 20:58:32 pgsql: doc PG 19 relnotes: remove doc author from "Allow autovacuum"