Fix health check process is not shutting down in certain cases.
authorTatsuo Ishii <ishii@sraoss.co.jp>
Tue, 11 Jun 2019 04:47:42 +0000 (13:47 +0900)
committerTatsuo Ishii <ishii@sraoss.co.jp>
Tue, 11 Jun 2019 05:02:20 +0000 (14:02 +0900)
commitb9ee8417ea74798c108498849d453e693246c3a1
treea3eb8f41f9f7f929d02aab9e39887327352023b9
parent45f01606361f2727537744ac2c450fb0624d2c04
Fix health check process is not shutting down in certain cases.

When watchdog detects fatal events, including not reaching to
trusted_servers, watchdog suicides with POOL_EXIT_FATAL exit status
code. In this case the parent of watchdog, the pgpool main process's
SIGCHILD handler reaper() exits and on_exit call back calls
system_will_go_down(), which in turn calls terminate_all_children().
Problem is, terminate_all_children() forgot to kill health check
process. This commit fixes that.

Also there are some not well behaving codings are enhanced.

Back patched to 3.7, when the bug was introduced.
src/main/pgpool_main.c