Re: Refine comments on usage WL_POSTMASTER_DEATH vs WL_EXIT_ON_PM_DEATH

From: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
To: Pavel Borisov <pashkin(dot)elfe(at)gmail(dot)com>, Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Refine comments on usage WL_POSTMASTER_DEATH vs WL_EXIT_ON_PM_DEATH
Date: 2024-10-23 17:00:00
Message-ID: 48926526-c659-45a0-b864-73e75589c7e0@iki.fi
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 23/10/2024 12:18, Pavel Borisov wrote:
> Hi, Hackers!
>
> Current comments on the usage of WL_POSTMASTER_DEATH state that it
> should be used for scenarios of finishing other than immediately i.e.
> returning values and waiting for postmaster dies.
> In fact, in parts of the code, it's currently used to immediately exit
> or throw FATAL (in the walsender and in libpq).
>
> So I propose change the comments on WL_POSTMASTER_DEATH stating that it
> could be used for both cases: for processing and setting return values
> if that's needed, and for immediate exit otherwise.

I see what you mean, but I don't think the proposed patch is making it
better. With WL_POSTMASTER_DEATH, the WaitLatch call returns if the
postmaster dies. What the caller does then is the caller's business.
That's different from WL_EXIT_ON_PM_DEATH in that with
WL_EXIT_ON_PM_DEATH, WaitLatch itself will do the exit(), not the caller.

--
Heikki Linnakangas
Neon (https://neon.tech)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Davis 2024-10-23 17:05:00 Re: Inconsistent use of relpages = -1
Previous Message Jacob Champion 2024-10-23 16:46:23 Re: [PoC] Federated Authn/z with OAUTHBEARER