agora inbox for pgsql-committers@postgresql.org  
help / color / mirror / Atom feed
From: Fujii Masao <fujii@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Use proc_exit() for walreceiver exit in WalRcvWaitForStartPositi
Date: Thu, 16 Apr 2026 03:33:59 +0000
Message-ID: <E1wDDUN-001Bcp-0G@gemulon.postgresql.org> (raw)

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

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(-)



Message-ID: <E1wDDUN-001Bcp-0G@gemulon.postgresql.org>
Permalink:  ../E1wDDUN-001Bcp-0G@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1wDDUN-001Bcp-0G@gemulon.postgresql.org

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: fujii@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Use proc_exit() for walreceiver exit in WalRcvWaitForStartPositi
  In-Reply-To: <E1wDDUN-001Bcp-0G@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox