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 1oYUCS-0001rQ-Oc for pgsql-committers@arkaria.postgresql.org; Wed, 14 Sep 2022 15:21:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oYUCR-0002PB-KR for pgsql-committers@arkaria.postgresql.org; Wed, 14 Sep 2022 15:21:15 +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 1oYUCR-0002Ns-7J for pgsql-committers@lists.postgresql.org; Wed, 14 Sep 2022 15:21:15 +0000 Received: from meldrar.postgresql.org ([2a02:c0:301:0:ffff::31]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oYUCO-0007zA-JD for pgsql-committers@lists.postgresql.org; Wed, 14 Sep 2022 15:21:14 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=postgresql.org; s=20171124; h=To:References:Message-Id: Content-Transfer-Encoding:Cc:Date:In-Reply-To:From:Subject:Mime-Version: Content-Type:Sender:Reply-To:Content-ID:Content-Description; bh=S5lzWx+g/D6pjCKdHfUPXj9Z/q3jyHFblXDLAGW8jhM=; b=tI96J/FyF53jyZg0tP+f1Ji9o+ fWdOImDxzQWs+wd/5QtveS2KHciatDQOXmemGG6B2xv+Mg4Z1y3fWW70T8DaPhr2DtDetH5JHaUWN 3yuoZQ1OkVbSBv6NcPsU5gK7u8QD4oOysp03QXLDVQ/SJPom3GYXR0DuCLTYwTggHA3FKR1PSr4hy WmJJDFMpAhYJXKPIjOBkyuuLQQAS3Vxz6ijO/sz4e39AQbu4dBkIEG7YDaNB+kdNnXJE0XDaPjPf2 8ufchUljJ+c6ZXOds5QRcuUCm1wnws9tXTmvSH/Lck+N97DerYKqrwHrxxUdZaN4Fy56N6tvR2Oh8 rKEJWZBw==; Received: from customer-89-255-232-193.stosn.net ([89.255.232.193] helo=smtpclient.apple) by meldrar.postgresql.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oYUCK-0008Ui-Qj; Wed, 14 Sep 2022 15:21:11 +0000 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.100.31\)) Subject: Re: pgsql: Handle SIGTERM in pg_receivewal and pg_recvlogical From: Daniel Gustafsson In-Reply-To: <2684964.1663167995@sss.pgh.pa.us> Date: Wed, 14 Sep 2022 17:21:06 +0200 Cc: pgsql-committers@lists.postgresql.org Content-Transfer-Encoding: 7bit Message-Id: <10F7C2B0-26D1-43E5-ACC5-2A05B2EF9CD7@postgresql.org> References: <2684964.1663167995@sss.pgh.pa.us> To: Tom Lane X-Mailer: Apple Mail (2.3696.100.31) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On 14 Sep 2022, at 17:06, Tom Lane wrote: > > Daniel Gustafsson writes: >> Since pg_recvlogical is also supposed to run as a daemon, teach it about >> SIGTERM as well and update the documentation to match. While in there, >> change pg_receivewal's time_to_stop to be sig_atomic_t like it is in >> pg_recvlogical. > > While looking at this commit, I wondered why both of those programs > are declaring their signal handlers like > > static void > sigint_handler(int signum) > > rather than our standard convention > > static void > pmdie(SIGNAL_ARGS) Sorry, I had missed that convention. > Evidently we don't (any longer?) have any platforms where SIGNAL_ARGS > is non-default, but that still doesn't make this good coding. More > than once I've grepped for SIGNAL_ARGS to locate signal handlers. > > Hmm, looks like same mistake in pg_waldump ... pg_test_fsync seems to have the same error. > barring objection, > I'm going to run around and fix those. No objections, unless you have better things to do and wan't me to clean up then I'll take care of it. > I also notice that port.h has > > typedef void (*pqsigfunc) (int signo); > extern pqsigfunc pqsignal(int signo, pqsigfunc func); > > which is a bit inconsistent with the idea that SIGNAL_ARGS > might be different from that. Shouldn't we declare it as > > typedef void (*pqsigfunc) (SIGNAL_ARGS); Agreed, that makes sense. -- Daniel Gustafsson https://vmware.com/