[pgpool-committers: 7769] pgpool: Fix watchdog communication race condition.

Tatsuo Ishii ishii at sraoss.co.jp
Sat May 22 13:02:41 JST 2021


Fix watchdog communication race condition.

Watchdog sends information from the watchdog process to the Pgpool-II
main process using SIGUSR1. To pass detailed messages it uses shared
memory area. First it sets a message to the shared memory area then
sends SIGUSR1 to the main process. The main process received the
signal and the signal handler sets a global variable so that
sigusr1_interrupt_processor() processes it. However it is possible
that while sigusr1_interrupt_processor() is running new signal
arrives. In this case the new signal is caught but the global variable
is set to 0 after sigusr1_interrupt_processor() returns. This means
that the new message is not processed until new signal arrives, which
could cause significant delay before the message was processed.

To fix the problem, sigusr1_interrupt_processor() is repeatedly called
until there's no pending message.

Discussion: https://www.pgpool.net/pipermail/pgpool-hackers/2021-May/003901.html

Branch
------
V4_0_STABLE

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

Modified Files
--------------
src/main/pgpool_main.c | 19 +++++++++++++------
1 file changed, 13 insertions(+), 6 deletions(-)



More information about the pgpool-committers mailing list