diff options
author | Bo Peng | 2024-11-25 07:53:54 +0000 |
---|---|---|
committer | Bo Peng | 2024-11-25 07:53:54 +0000 |
commit | 551117e96bccddc57fb6e333da3cbd00f8b659a0 (patch) | |
tree | dce5ea6f7d0c83e4f741dc52af168c0e18f26798 | |
parent | 1cf7ad32cc22a7867d65bf540aab400d3514683d (diff) |
Fix the watchdog process not reloading configurations.
The reload_config() function in Pgpool-II should send a SIGHUP signal to the watchdog process.
-rw-r--r-- | src/main/pgpool_main.c | 21 | ||||
-rw-r--r-- | src/watchdog/watchdog.c | 2 |
2 files changed, 16 insertions, 7 deletions
diff --git a/src/main/pgpool_main.c b/src/main/pgpool_main.c index 60bc675b1..1fbc2ccd9 100644 --- a/src/main/pgpool_main.c +++ b/src/main/pgpool_main.c @@ -2204,18 +2204,27 @@ kill_all_children(int sig) } } } - /* make PCP process reload as well */ - if (sig == SIGHUP && pcp_pid > 0) - kill(pcp_pid, sig); - /* make health check process reload as well */ if (sig == SIGHUP) { + /* make PCP process reload as well */ + if (pcp_pid > 0) + kill(pcp_pid, sig); + + /* make health check process reload as well */ for (i = 0; i < NUM_BACKENDS; i++) { if (health_check_pids[i] > 0) kill(health_check_pids[i], sig); } + + /* make worker process reload as well */ + if (worker_pid > 0) + kill(worker_pid, sig); + + /* make watchdog process reload as well */ + if (watchdog_pid > 0) + kill(watchdog_pid, sig); } } @@ -3445,10 +3454,8 @@ reload_config(void) MemoryContextSwitchTo(oldContext); if (pool_config->enable_pool_hba) load_hba(hba_file); - kill_all_children(SIGHUP); - if (worker_pid) - kill(worker_pid, SIGHUP); + kill_all_children(SIGHUP); } /* Call back function to unlink the file */ diff --git a/src/watchdog/watchdog.c b/src/watchdog/watchdog.c index 0c29cc68d..8b6fb76cc 100644 --- a/src/watchdog/watchdog.c +++ b/src/watchdog/watchdog.c @@ -1182,6 +1182,8 @@ check_signals(void) /* reload config file signal? */ if (reload_config_signal) { + ereport(LOG, + (errmsg("reloading config file"))); MemoryContext oldContext = MemoryContextSwitchTo(TopMemoryContext); pool_get_config(get_config_file_name(), CFGCXT_RELOAD); |