[pgpool-committers: 7767] pgpool: Fix watchdog communication race condition.
Tatsuo Ishii
ishii at sraoss.co.jp
Sat May 22 13:02:31 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_6_STABLE
Details
-------
https://git.postgresql.org/gitweb?p=pgpool2.git;a=commitdiff;h=771cfe7423df2bb6fd832a8df20c932a1f1f2269
Modified Files
--------------
src/main/pgpool_main.c | 21 ++++++++++++++-------
1 file changed, 14 insertions(+), 7 deletions(-)
More information about the pgpool-committers
mailing list