Re: SIGQUIT on archiver child processes maybe not such a hot idea?

From: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
To: tsunakawa(dot)takay(at)jp(dot)fujitsu(dot)com
Cc: tgl(at)sss(dot)pgh(dot)pa(dot)us, sfrost(at)snowman(dot)net, david(at)pgmasters(dot)net, michael(at)paquier(dot)xyz, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: SIGQUIT on archiver child processes maybe not such a hot idea?
Date: 2019-09-11 05:32:56
Message-ID: 20190911.143256.27701049.horikyota.ntt@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

At Wed, 11 Sep 2019 11:01:24 +0900 (Tokyo Standard Time), Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com> wrote in <20190911(dot)110124(dot)96874741(dot)horikyota(dot)ntt(at)gmail(dot)com>
> At Wed, 11 Sep 2019 01:36:15 +0000, "Tsunakawa, Takayuki" <tsunakawa(dot)takay(at)jp(dot)fujitsu(dot)com> wrote in <0A3221C70F24FB45833433255569204D1FD33579(at)G01JPEXMBYT05>
> > From: Tom Lane [mailto:tgl(at)sss(dot)pgh(dot)pa(dot)us]
> > > SIGTERM, which needs to be adjusted. For another, its
> > > SIGQUIT handler does exit(1) not _exit(2), which seems rather
> > > dubious ... should we make it more like the rest? I think
> > > the reasoning there might've been that if some DBA decides to
> > > SIGQUIT the archiver, we don't need to force a database-wide
> > > reset; but why exactly should we tolerate that?
> >
> > postmaster doesn't distinguish return codes other than 0 for the archiver, and just starts the archiver unless postmaster is shutting down. So we can use _exit(2) like the other children.
> >
> > Can't we use SIGKILL instead of SIGINT/SIGTERM to stop the grandchildren, just in case they are slow to respond to or ignore SIGINT/SIGTERM? That matches the idea of pg_ctl's immediate shutdown.
>
> Perhaps +1.. immediate -> SIGKILL fast -> SIGTERM?

We send SIGUSR2 to archive while fast shutdown. It would be
enough for pg_system to do signal(SNGINT, DIG_DFL) andsignal
signal(SIGQUIT, SIG_IGN) then remember the child's pid somewhere.
Then each process send SIGKILL to the remembered process in
sigquit handler. (I'm not sure what happens if kill(0,
SIGKILL)).

regards.

--
Kyotaro Horiguchi
NTT Open Source Software Center

Attachment Content-Type Size
replace-quit-to-kill-in-archiver.patch text/x-patch 2.1 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message gc_11 2019-09-11 05:37:40 回复:Re: Does PostgreSQL support debian Linux on Arm CPU Platform?
Previous Message Andrey Borodin 2019-09-11 05:24:37 Re: ICU for global collation