v2-0001-Use-proc_exit-in-WalRcvWaitForStartPosition.patch

application/octet-stream

Filename: v2-0001-Use-proc_exit-in-WalRcvWaitForStartPosition.patch
Type: application/octet-stream
Part: 0
Message: Re: Use proc_exit() in WalRcvWaitForStartPosition

Patch

Same data as JSON: GET /api/v1/attachments/:id/patch the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes. API reference →
Format: format-patch
Series: patch v2-0001
Subject: Use proc_exit() in WalRcvWaitForStartPosition
File+
src/backend/replication/walreceiver.c 2 2
From e1070dbd77f251774fcddee163f16fbd89b70be5 Mon Sep 17 00:00:00 2001
From: "Chao Li (Evan)" <lic@highgo.com>
Date: Wed, 8 Apr 2026 17:02:28 +0800
Subject: [PATCH v2] Use proc_exit() in WalRcvWaitForStartPosition

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
---
 src/backend/replication/walreceiver.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/backend/replication/walreceiver.c b/src/backend/replication/walreceiver.c
index 09fde92bfd7..0941c9c4674 100644
--- a/src/backend/replication/walreceiver.c
+++ b/src/backend/replication/walreceiver.c
@@ -30,7 +30,7 @@
  * a new one.
  *
  * Normal termination is by SIGTERM, which instructs the walreceiver to
- * exit(0). Emergency termination is by SIGQUIT; like any postmaster child
+ * terminate. Emergency termination is by SIGQUIT; like any postmaster child
  * process, the walreceiver will simply abort and exit on SIGQUIT. A close
  * of the connection and a FATAL error are treated not as a crash but as
  * normal operation.
@@ -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)