public inbox for [email protected]  
help / color / mirror / Atom feed
From: Chao Li <[email protected]>
To: PostgreSQL-development <[email protected]>
Subject: Use proc_exit() in WalRcvWaitForStartPosition
Date: Wed, 8 Apr 2026 17:08:36 +0800
Message-ID: <[email protected]> (raw)

Hi,

While working on another patch, I happened to notice that WalRcvWaitForStartPosition() calls raw exit(1). I think this should use proc_exit(1) instead, so that the normal cleanup machinery is not bypassed.

This tiny patch just replaces exit(1) with proc_exit(1) in WalRcvWaitForStartPosition().

Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/






Attachments:

  [application/octet-stream] v1-0001-Use-proc_exit-in-WalRcvWaitForStartPosition.patch (860B, 2-v1-0001-Use-proc_exit-in-WalRcvWaitForStartPosition.patch)
  download | inline diff:
From 2a05e01c58100349bf4815d82cd0ed6f0efc967f Mon Sep 17 00:00:00 2001
From: "Chao Li (Evan)" <[email protected]>
Date: Wed, 8 Apr 2026 17:02:28 +0800
Subject: [PATCH v1] Use proc_exit() in WalRcvWaitForStartPosition

Author: Chao Li <[email protected]>
---
 src/backend/replication/walreceiver.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/backend/replication/walreceiver.c b/src/backend/replication/walreceiver.c
index 09fde92bfd7..47c238557b2 100644
--- a/src/backend/replication/walreceiver.c
+++ b/src/backend/replication/walreceiver.c
@@ -710,7 +710,7 @@ WalRcvWaitForStartPosition(XLogRecPtr *startpoint, TimeLineID *startpointTLI)
 			 * to die, but might as well check it here too.
 			 */
 			SpinLockRelease(&walrcv->mutex);
-			exit(1);
+			proc_exit(1);
 		}
 		SpinLockRelease(&walrcv->mutex);
 
-- 
2.50.1 (Apple Git-155)



view thread (9+ messages)  latest in thread

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: [email protected]
  Cc: [email protected]
  Subject: Re: Use proc_exit() in WalRcvWaitForStartPosition
  In-Reply-To: <[email protected]>

* 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