Re: Refine comments on usage WL_POSTMASTER_DEATH vs WL_EXIT_ON_PM_DEATH

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Pavel Borisov <pashkin(dot)elfe(at)gmail(dot)com>
Cc: 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 22:40:17
Message-ID: CAKFQuwbqj6hhLErTVNJw50AC4tUF8_fYUdsv0_3d6LbMbGqEjw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wednesday, October 23, 2024, Pavel Borisov <pashkin(dot)elfe(at)gmail(dot)com>
wrote:

>
> In fact, in parts of the code, it's currently used to immediately exit or
> throw FATAL (in the walsender and in libpq).
>

Maybe submit a patch to fix these parts of the code that should apparently
be using WL_EXIT_ON_PM_DEATH to do so instead of an unnecessary
self-directed exit?

The comment needn’t tell the developer that it is possible code things in
such a way using WL_POSTMASTER_DEATH that is redundant with what they could
more easily accomplish using WL_EXIT_ON_PM_DEATH. Doing nothing is always
an option, but one not recommended and thus not pointed out.

The only thing that I could see not leaving implied is that if you don’t
use WL_EXIT_ON_PM_DEATH and the postmaster does die your handler code must
terminate your process explicitly (I suppose “must” really is “should”
because I suspect when the postmaster is done dead it will have taken its
children to /dev/null along with it…).

David J.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2024-10-23 22:40:19 Re: Refactor to use common function 'get_publications_str'.
Previous Message Peter Smith 2024-10-23 22:26:19 Re: Refactor to use common function 'get_publications_str'.