Re: Logical replication launcher did not automatically restart when got SIGKILL

shveta malik <shveta.malik@gmail.com>

From: shveta malik <shveta.malik@gmail.com>
To: cca5507 <cca5507@qq.com>
Cc: Fujii Masao <masao.fujii@oss.nttdata.com>, pgsql-hackers <pgsql-hackers@lists.postgresql.org>, shveta malik <shveta.malik@gmail.com>
Date: 2025-07-17T09:57:41Z
Lists: pgsql-hackers
On Wed, Jul 16, 2025 at 8:51 AM cca5507 <cca5507@qq.com> wrote:
>
> Hi,
>
> The v1-0002 in [1] will call ReportBackgroundWorkerExit() which will send SIGUSR1 to 'bgw_notify_pid', but it may already exit in HandleChildCrash(), is this ok?
>

Shall ReportBackgroundWorkerExit() be skipped for 'crashed' background worker?

If we look at code prior to commit 28a520c0b77, there we were setting
'rw_crashed_at' in CleanupBackgroundWorker() and then
HandleChildCrash() was resetting the pid and exiting with no
additional processing.

thanks
Shveta



Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Add regression test for background worker restart after crash.

  2. Fix background worker not restarting after crash-and-restart cycle.

  3. Refactor code to handle death of a backend or bgworker in postmaster