[pgpool-committers: 8541] pgpool: Fix exit_handler in pgpool main process.

Tatsuo Ishii ishii at sraoss.co.jp
Sat Apr 16 10:22:15 JST 2022


Fix exit_handler in pgpool main process.

It was allowed to be interrupted by signals (SIGTERM, SIGINT and
SOGQUIT) while the exit_handler. As a resit, exit_handler is executed
while executing exit_handler. This could cause infinite wait in
terminate_childrens() which is called from exit_handler.  To prevent
this, protect variable "exiting" using semaphore to make sure that
only one instance of exit_handler runs at the same time.

Discussion: https://www.pgpool.net/pipermail/pgpool-hackers/2022-April/004149.html

Branch
------
V4_1_STABLE

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

Modified Files
--------------
src/include/pool.h     |  3 ++-
src/main/pgpool_main.c | 44 +++++++++++++++++++++++++++++++++++++++++---
2 files changed, 43 insertions(+), 4 deletions(-)



More information about the pgpool-committers mailing list