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

Tatsuo Ishii ishii at sraoss.co.jp
Thu Apr 14 21:06:48 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_2_STABLE

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

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



More information about the pgpool-committers mailing list