public inbox for [email protected]
help / color / mirror / Atom feedFrom: Tatsuo Ishii <[email protected]>
To: [email protected]
Cc: [email protected]
Subject: Re: Fix signal handler in pgpool main
Date: Tue, 23 Jun 2026 21:54:23 +0900 (JST)
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
Hi Emond,
> I got a bug report regarding pgpool main process from Emond Papegaaij:
> its exit/reload signal handler uses non signal safe functions, and it
> could lead to a crash of the process.
>
> Attached is the patch from him generated by Claude Code, with slight
> modifications by me.
>
> Basically it changes the signal handler to async-signal-safe calls
> only: capture the signal number into a new volatile sig_atomic_t
> main_exit_request, write one byte to the existing self-pipe to wake
> the main loop, restore errno, and return. The actual shutdown is
> performed synchronously by a new do_shutdown() function called from
> the pgpol main loop at the top of every iteration (via
> check_requests()) and also right after the inner pool_pause() returns,
> so a signal arriving during the 2-second select() sleep is acted on
> without an extra tick of latency.
>
> I think this patch is important and worth to apply to all supported
> branches.
>
> However, since it touches one of the most critical part of pgpool, I
> would like to apply to master branch first and see how our build-farm
> acts before back patching (it will take a few days).
>
> Comments?
Patch pushed to v4.4.
Peng and Koshino reviewed the patch off-list. No change was necessary.
I just removed some non-ASCII characters in comments (probably I
mistakenly brought them in by copy-and-paste). I tried to back-patch
to v4.3 but it seems it needs invasive changes and I gave up it. So I
decided to back patch through v4.4.
Thank you!
--
Tatsuo Ishii
SRA OSS K.K.
English: http://www.sraoss.co.jp/index_en/
Japanese:http://www.sraoss.co.jp
view thread (3+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected]
Subject: Re: Fix signal handler in pgpool main
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox