Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1w2tga-000hzn-20 for pgsql-hackers@arkaria.postgresql.org; Wed, 18 Mar 2026 16:23:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w2tgZ-00CO99-1Q for pgsql-hackers@arkaria.postgresql.org; Wed, 18 Mar 2026 16:23:55 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1w2tgZ-00CO90-0W for pgsql-hackers@lists.postgresql.org; Wed, 18 Mar 2026 16:23:55 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1w2tgW-00000000xgl-2M3j for pgsql-hackers@lists.postgresql.org; Wed, 18 Mar 2026 16:23:54 +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 62IGNph2768858; Wed, 18 Mar 2026 12:23:51 -0400 From: Tom Lane To: Fujii Masao cc: PostgreSQL Hackers Subject: Re: Use SIGTERM instead of SIGUSR1 for slotsync worker to exit during promotion? In-reply-to: References: Comments: In-reply-to Fujii Masao message dated "Thu, 19 Mar 2026 01:05:29 +0900" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <768856.1773851031.1@sss.pgh.pa.us> Date: Wed, 18 Mar 2026 12:23:51 -0400 Message-ID: <768857.1773851031@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Fujii Masao writes: > I noticed that during standby promotion the startup process sends SIGUSR1 to > the slotsync worker to make it exit. Is there a reason for using SIGUSR1? > Would it make sense to send SIGTERM instead, so the worker can exit promptly > even while waiting? One consideration here is that we expect all processes to receive SIGTERM from init at the beginning of an operating system shutdown sequence. Background workers should exit at that point only if their services will not be needed during database shutdown. While it sounds plausible that a slotsync worker should exit immediately, I'm not quite sure if that's what we want. regards, tom lane