pgpool: Convert lifecheck_exit_handler to flag-only.

From: Taiki Koshino <koshino(at)sraoss(dot)co(dot)jp>
To: pgpool-committers(at)lists(dot)postgresql(dot)org
Subject: pgpool: Convert lifecheck_exit_handler to flag-only.
Date: 2026-09-16 08:36:04
Message-ID: E1x6l7c-0000000Copo-0lzC@gothos.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgpool-committers

Convert lifecheck_exit_handler to flag-only.

The watchdog lifecheck exit handler performed non-async-signal-safe
operations, including ereport(), wait(), pfree(), and exit(). The memory
cleanup could also conflict with MemoryContext operations interrupted by
the signal handler.

Changes:
Flag-only Signal Handler: Make lifecheck_exit_handler() only record the
signal and set volatile sig_atomic_t flags while preserving errno.

Normal-context Cleanup: Move child termination, cleanup, and process exit
to process_lifecheck_exit_request().

Reported-by: Emond Papegaaij <emond(dot)papegaaij(at)gmail(dot)com>
Reported-by: Claude Code
Author: Taiki Koshino <koshino(at)sraoss(dot)co(dot)jp>
Discussion: https://www.postgresql.org/message-id/OS9P286MB6486FF7EC3D412F5D9B2E45F94AE2%40OS9P286MB6486.JPNP286.PROD.OUTLOOK.COM
Backpatch-through: v4.3

Branch
------
V4_4_STABLE

Details
-------
https://git.postgresql.org/gitweb?p=pgpool2.git;a=commitdiff;h=fccee62148a0766bb6c7c09d98ddeaf5d2463bd3

Modified Files
--------------
src/watchdog/wd_lifecheck.c | 49 +++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 49 insertions(+)

Browse pgpool-committers by date

  From Date Subject
Next Message Taiki Koshino 2026-09-16 08:36:33 pgpool: Convert lifecheck_exit_handler to flag-only.
Previous Message Taiki Koshino 2026-09-16 08:35:45 pgpool: Convert lifecheck_exit_handler to flag-only.