Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kG1VQ-0002Xi-3T for pgsql-hackers@arkaria.postgresql.org; Wed, 09 Sep 2020 14:55:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kG1VP-00035E-0v for pgsql-hackers@arkaria.postgresql.org; Wed, 09 Sep 2020 14:55:27 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kG1VO-000357-QH for pgsql-hackers@lists.postgresql.org; Wed, 09 Sep 2020 14:55:26 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kG1VM-00045b-Lo for pgsql-hackers@lists.postgresql.org; Wed, 09 Sep 2020 14:55:25 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 089EtNXT013220; Wed, 9 Sep 2020 10:55:23 -0400 From: Tom Lane To: Stephen Frost cc: pgsql-hackers@lists.postgresql.org Subject: Re: SIGQUIT handling, redux In-reply-to: <12863.1599662788@sss.pgh.pa.us> References: <1850884.1599601164@sss.pgh.pa.us> <20200909143900.GQ29590@tamriel.snowman.net> <12863.1599662788@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Wed, 09 Sep 2020 10:46:28 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <13218.1599663323.1@sss.pgh.pa.us> Date: Wed, 09 Sep 2020 10:55:23 -0400 Message-ID: <13219.1599663323@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk I wrote: > Stephen Frost writes: >> As I mentioned over there, I agree that we should do this and we should >> further have the statistics collector also do so, which currently sets >> up SIGQUIT with ShutdownRequestPending() and in its loop decides it's >> fine to write out the stats file (which we're going to remove during >> recovery anyway...) and then call exit(0). > I noticed that that was different from everything else, but it's not > actually signal-unsafe, so it seems like a different topic from what > I'm on about at the moment. I don't mind if you or somebody else > wants to change it, but I don't see it as a back-patchable bug fix. Note also that the postmaster actually uses SIGQUIT to command normal shutdown of the stats collector (cf reaper(), around line 3125 in HEAD). So this needs a change in signaling conventions, not just internal tweaks in the collector. Not a big deal, but it reinforces my feeling that it should be a HEAD-only change. regards, tom lane