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 1kiXgj-0001wL-SL for pgsql-hackers@arkaria.postgresql.org; Fri, 27 Nov 2020 06:57:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kiXgi-0007kt-Qg for pgsql-hackers@arkaria.postgresql.org; Fri, 27 Nov 2020 06:57:00 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kiXgi-0007km-Jw for pgsql-hackers@lists.postgresql.org; Fri, 27 Nov 2020 06:57:00 +0000 Received: from oss.nttdata.com ([49.212.34.109]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kiXgf-0005mh-Q7 for pgsql-hackers@postgresql.org; Fri, 27 Nov 2020 06:57:00 +0000 Received: from hnk.local (p1295030-ipngn4902funabasi.chiba.ocn.ne.jp [153.166.85.30]) by oss.nttdata.com (Postfix) with ESMTPSA id D015B62728; Fri, 27 Nov 2020 15:56:52 +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: Bharath Rupireddy Cc: Craig Ringer , PostgreSQL-development , Robert Haas References: <13156732-5189-af54-3d28-e2ee2a8568e0@oss.nttdata.com> <069fb3bc-3907-4d85-19fd-e4b2d2f004b4@oss.nttdata.com> <1ae40b1b-2f42-4510-1514-40bb7d7255ab@oss.nttdata.com> <3f292fbb-f155-9a01-7cb2-7ccc9007ab3f@oss.nttdata.com> From: Fujii Masao Message-ID: <9e3f88cd-0cc4-ac9e-4102-505ac8213fc9@oss.nttdata.com> Date: Fri, 27 Nov 2020 15:56:52 +0900 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2020/11/27 12:13, Bharath Rupireddy wrote: > On Wed, Nov 25, 2020 at 8:08 PM Bharath Rupireddy > wrote: > > > > > When I read the patch again, I found that, with the patch, the shutdown > > > of worker_spi causes to report the following FATAL message. > > > > > >      FATAL:  terminating connection due to administrator command > > > > > > Isn't this message confusing because it's not a connection? If so, > > > we need to update ProcessInterrupts() so that the proper message is > > > reported like other bgworkers do. > > > > > > > This is also true for all the bgworker that use the die() handler. How about doing it the way bgworker_die() does in ProcessInterrupts()? This would give meaningful information. Thoughts? If okay, I can make a separate patch. > > > > Attaching the patch that improved the message for bg workers in ProcessInterrupts(). For instance, now it looks like *FATAL:  terminating background worker "worker_spi" due to administrator command* or *FATAL:  terminating background worker "parallel worker" due to administrator command *and so on for other bg workers.* > * > > Please review the patch. Thanks for the patch! It looks good to me. > > I'm also mentioning the 2 previous patches posted in [1]. One of the patch is for using die() instead of handle_sigterm() in test_shm_mq/worker.c and another is for replacing custom SIGTERM handler worker_spi_sigterm() with die() and custom SIGHUP handler worker_spi_sighup() with standard SignalHandlerForConfigReload() Yeah, I pushed them. Thanks! Regards, -- Fujii Masao Advanced Computing Technology Center Research and Development Headquarters NTT DATA CORPORATION