public inbox for [email protected]  
help / color / mirror / Atom feed
From: Andreas Karlsson <[email protected]>
To: Chao Li <[email protected]>
To: PostgreSQL-development <[email protected]>
Subject: Re: Use proc_exit() in WalRcvWaitForStartPosition
Date: Wed, 8 Apr 2026 22:59:52 +0200
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>

On 4/8/26 11:08 AM, Chao Li wrote:
> 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().

This looks likely to be correct since when we exit in WalReceiverMain() 
(on WALRCV_STOPPING and WALRCV_STOPPED) we call proc_exit(1). I feel we 
should exit the same way in WalRcvWaitForStartPosition() as we do in 
WalReceiverMain() and if not I would like a comment explaining why those 
two cases are different.

Andreas






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], [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