Re: "wal receiver" process hang in syslog() while exiting after receiving SIGTERM while the postgres has been promoted.

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: "Chen, Yan-Jack (NSB - CN/Hangzhou)" <yan-jack(dot)chen(at)nokia-sbell(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: "wal receiver" process hang in syslog() while exiting after receiving SIGTERM while the postgres has been promoted.
Date: 2018-06-26 15:53:53
Message-ID: CA+TgmoaCgbsKcbwojUv7S1uSAvV1G5atrXCbsY3DPSygjsg7Cg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Jun 26, 2018 at 4:12 AM, Chen, Yan-Jack (NSB - CN/Hangzhou)
<yan-jack(dot)chen(at)nokia-sbell(dot)com> wrote:
> Hi,
> Well, if you agree with do not write log in signal handling function in any circumstance

I don't understand this sentence.

> I see in many cases in postgresql signal handling function just set one flag which triggers its main process to handling the progress.

Right, that's a good way to do it.

> How about simply remove the code lines?
>
> --- walreceiver_old.c
> +++ walreceiver.c
> @@ -816,10 +816,6 @@
>
> SetLatch(&WalRcv->latch);
>
> - /* Don't joggle the elbow of proc_exit */
> - if (!proc_exit_inprogress && WalRcvImmediateInterruptOK)
> - ProcessWalRcvInterrupts();
> -
> errno = save_errno;
> }

Hmm, I doubt it's that simple but I haven't studied this.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2018-06-26 15:58:18 Re: Small fixes about backup history file in doc and pg_standby
Previous Message David G. Johnston 2018-06-26 15:48:43 Unexpected behavior of DROP VIEW/TABLE IF EXISTS