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

Tatsuo Ishii ishii at sraoss.co.jp
Sat May 22 13:02:36 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
------
V3_7_STABLE

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

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



More information about the pgpool-committers mailing list