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 1kb5Ze-00014P-BI for pgsql-hackers@arkaria.postgresql.org; Fri, 06 Nov 2020 17:30:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kb5Zc-0006td-Nh for pgsql-hackers@arkaria.postgresql.org; Fri, 06 Nov 2020 17:30:52 +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 1kb5Zc-0006tW-Gw for pgsql-hackers@lists.postgresql.org; Fri, 06 Nov 2020 17:30:52 +0000 Received: from oss.nttdata.com ([49.212.34.109]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kb5ZY-0007E8-Pi for pgsql-hackers@postgresql.org; Fri, 06 Nov 2020 17:30:51 +0000 Received: from hnk.local (p1295030-ipngn4902funabasi.chiba.ocn.ne.jp [153.166.85.30]) by oss.nttdata.com (Postfix) with ESMTPSA id D01786238E; Sat, 7 Nov 2020 02:30:44 +0900 (JST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.102.3 at oss.nttdata.com Subject: Re: Use standard SIGHUP and SIGTERM handlers in autoprewarm module To: Kyotaro Horiguchi , bharath.rupireddyforpostgres@gmail.com Cc: pgsql-hackers@postgresql.org References: <6b561c73-27ce-7079-b6e5-440e49653810@oss.nttdata.com> <20201105.121206.819769369617763972.horikyota.ntt@gmail.com> From: Fujii Masao Message-ID: Date: Sat, 7 Nov 2020 02:30:44 +0900 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.4.0 MIME-Version: 1.0 In-Reply-To: <20201105.121206.819769369617763972.horikyota.ntt@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2020/11/05 12:12, Kyotaro Horiguchi wrote: > At Wed, 4 Nov 2020 21:16:29 +0530, Bharath Rupireddy wrote in >> On Wed, Nov 4, 2020 at 2:36 PM Fujii Masao wrote: >>> >>> Regarding other two patches, I think that it's better to use MyLatch >>> rather than MyProc->procLatch or walrcv->latch in WaitLatch() and >>> ResetLatch(), like other code does. Attached are the updated versions >>> of the patches. Thought? >>> >> >> +1 for replacing MyProc->procLatch with MyLatch in the autoprewarm >> module, and the patch looks good to me. > > Looks good to me, too. Thanks for the review! I pushed the patch. > >> I'm not quite sure to replace all the places in the walreceiver >> process, for instance in WalRcvForceReply() we are using spinlock to >> acquire the latch pointer and . Others may have better thoughts on >> this. > > The SIGTERM part looks good. The only difference between > WalRcvSigHupHandler and SignalHandlerForConfigReload is whether latch > is set or not. I don't think it's a problem that config-reload causes > an extra wakeup. Couldn't we do the same thing for SIGHUP? I agree that we can use even standard SIGHUP handler in walreceiver. I'm not sure why SetLatch() was not called in walreceiver's SIGHUP handler so far. Regards, -- Fujii Masao Advanced Computing Technology Center Research and Development Headquarters NTT DATA CORPORATION