Re: Use SIGTERM instead of SIGUSR1 for slotsync worker to exit during promotion?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Use SIGTERM instead of SIGUSR1 for slotsync worker to exit during promotion?
Date: 2026-03-18 16:23:51
Message-ID: 768857.1773851031@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Fujii Masao <masao(dot)fujii(at)gmail(dot)com> 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Álvaro Herrera 2026-03-18 16:34:36 Re: Order of InvokeObjectPostAlterHook within ATExecSetNotNull
Previous Message Artur Zakirov 2026-03-18 16:21:06 Order of InvokeObjectPostAlterHook within ATExecSetNotNull