| 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:33 |
| Message-ID: | E1x6l84-0000000CpGA-31jg@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_3_STABLE
Details
-------
https://git.postgresql.org/gitweb?p=pgpool2.git;a=commitdiff;h=4b978ae63679750f918e70cdf9ccfd8fd32fd624
Modified Files
--------------
src/watchdog/wd_lifecheck.c | 49 +++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 49 insertions(+)
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Taiki Koshino | 2026-09-16 08:46:09 | pgpool: Convert close_idle_connection (SIGUSR1) to flag-only handler wi |
| Previous Message | Taiki Koshino | 2026-09-16 08:36:04 | pgpool: Convert lifecheck_exit_handler to flag-only. |