Use proc_exit() for walreceiver exit in WalRcvWaitForStartPosition()

Fujii Masao <fujii@postgresql.org>

Commit: ee550254a29a4ccd3852f14b1806b8ffe26b7454
Author: Fujii Masao <fujii@postgresql.org>
Date: 2026-04-16T03:33:17Z
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@highgo.com>
Reviewed-by: Fujii Masao <masao.fujii@gmail.com>
Reviewed-by: Andreas Karlsson <andreas@proxel.se>
Reviewed-by: Xuneng Zhou <xunengzhou@gmail.com>
Discussion: https://postgr.es/m/74381238-4E8A-4621-B794-57025DCCE0BA@gmail.com

Files

PathChange+/−
src/backend/replication/walreceiver.c modified +4 −4

Discussion