From a85b848cc5e749051e3edfb892bdb366f7c23a31 Mon Sep 17 00:00:00 2001 From: Tatsuo Ishii Date: Wed, 13 Aug 2025 20:08:08 +0900 Subject: [PATCH] Emit warning if life check has not started yet. Currently lifecheck emits a log only when life check becomes ready. This is inconvenient for admins since they need to keep on watching log file until life check is ready. This commit makes the life check process to emit additional warnings periodically until life check has started. The interval of the warnings is wd_interval * 10 seconds. However for the first time at lifecheck starting, no warning is emitted since it is likely that lifecheck is not ready at that point. --- src/watchdog/wd_lifecheck.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/watchdog/wd_lifecheck.c b/src/watchdog/wd_lifecheck.c index 5830d82af..0694a2228 100644 --- a/src/watchdog/wd_lifecheck.c +++ b/src/watchdog/wd_lifecheck.c @@ -378,6 +378,7 @@ lifecheck_main(void) { sigjmp_buf local_sigjmp_buf; int i; + bool need_life_check_warning = false; ereport(DEBUG1, (errmsg("I am watchdog lifecheck child with pid:%d", getpid()))); @@ -424,6 +425,14 @@ lifecheck_main(void) /* wait until ready to go */ while (WD_OK != is_wd_lifecheck_ready()) { + /* + * For the first time we do not emit warning since it is likely the + * life check is not ready. + */ + if (need_life_check_warning) + ereport(WARNING, + (errmsg("watchdog: lifecheck has not started yet"))); + need_life_check_warning = true; sleep(pool_config->wd_interval * 10); } -- 2.39.5