From a3b0ec28fcbf61a3a16d98e6e21204ea754d02cb Mon Sep 17 00:00:00 2001 From: Nick Bolton Date: Mon, 10 Feb 2025 19:36:46 +0000 Subject: [PATCH] refactor: Improve logging message for process backoff and reset failure count when no command is set --- src/lib/platform/MSWindowsWatchdog.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib/platform/MSWindowsWatchdog.cpp b/src/lib/platform/MSWindowsWatchdog.cpp index c694a06ca..2599ec56d 100644 --- a/src/lib/platform/MSWindowsWatchdog.cpp +++ b/src/lib/platform/MSWindowsWatchdog.cpp @@ -207,7 +207,7 @@ void MSWindowsWatchdog::mainLoop(void *) // only start sleeping at 1 second to avoid unnecessary delay when the process stops // for the first failure (i.e. when the process just stopped running). int timeout = m_processFailures < 10 ? m_processFailures : 10; - LOG_WARN("backing off, wait=%ds, failures=%d", timeout, m_processFailures); + LOG_WARN("backing off after failure, wait=%ds, failures=%d", timeout, m_processFailures); ARCH->sleep(timeout); } @@ -225,6 +225,9 @@ void MSWindowsWatchdog::mainLoop(void *) if (startNeeded) { startProcess(); } + } else { + // prevent backoff when no command is set. + m_processFailures = 0; } if (m_processStarted && !isProcessRunning()) {