Re: Refine comments on usage WL_POSTMASTER_DEATH vs WL_EXIT_ON_PM_DEATH - Mailing list pgsql-hackers

From David G. Johnston
Subject Re: Refine comments on usage WL_POSTMASTER_DEATH vs WL_EXIT_ON_PM_DEATH
Date
Msg-id CAKFQuwbqj6hhLErTVNJw50AC4tUF8_fYUdsv0_3d6LbMbGqEjw@mail.gmail.com
Whole thread Raw
List pgsql-hackers
On Wednesday, October 23, 2024, Pavel Borisov <pashkin.elfe@gmail.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.

pgsql-hackers by date:

Previous
From: Melanie Plageman
Date:
Subject: Re: Using read_stream in index vacuum
Next
From: Masahiko Sawada
Date:
Subject: Re: Refactor to use common function 'get_publications_str'.