Re: Can a child process detect postmaster death when in pg_usleep?

From: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
To: michael(at)paquier(dot)xyz
Cc: tgl(at)sss(dot)pgh(dot)pa(dot)us, bharath(dot)rupireddyforpostgres(at)gmail(dot)com, thomas(dot)munro(at)gmail(dot)com, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Can a child process detect postmaster death when in pg_usleep?
Date: 2021-07-05 05:52:51
Message-ID: 20210705.145251.462698229911576780.horikyota.ntt@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

At Fri, 2 Jul 2021 10:27:21 +0900, Michael Paquier <michael(at)paquier(dot)xyz> wrote in
> On Mon, Jun 28, 2021 at 11:01:57AM -0400, Tom Lane wrote:
> > Dunno ... I cannot recall ever having had that as a debugging requirement
> > in a couple of decades worth of PG bug-chasing. If the postmaster is
> > dying, you generally want to deal with that before bothering with child
> > processes. Moreover, child processes that don't go awy when the
> > postmaster does are a very nasty problem, because they could screw up
> > subsequent debugging work.
>
> At the same time, nobody has really complained about this being an
> issue for developer options. I would tend to wait for more opinions
> before doing anything with the auth_delay GUCs.

I'm not sure the current behavior is especially useful for debugging,
however, I don't think it is especially useful that children
immediately respond to postmaster's death while the debug-delays,
because anyway children don't respond while debugging (until the
control (or code-pointer) reaches to the point of checking
postmaster's death), and the delays must be very short even if someone
abuses it on production systems. On the other hand, there could be a
discussion as a convention that any user-definable sleep requires to
respond to signals, maybe as Thomas mentioned.

So, I don't object either way we will go. But if we don't change the
behavior we instead would need a comment that explains the reason for
the pg_usleep.

regards.

--
Kyotaro Horiguchi
NTT Open Source Software Center

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bharath Rupireddy 2021-07-05 06:18:17 Re: "debug_invalidate_system_caches_always" is too long
Previous Message Amul Sul 2021-07-05 05:33:13 Re: "debug_invalidate_system_caches_always" is too long