refactor: Improve logging message for process backoff and reset failure count when no command is set
This commit is contained in:
parent
fa1ab27ee9
commit
a3b0ec28fc
1 changed files with 4 additions and 1 deletions
|
|
@ -207,7 +207,7 @@ void MSWindowsWatchdog::mainLoop(void *)
|
||||||
// only start sleeping at 1 second to avoid unnecessary delay when the process stops
|
// 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).
|
// for the first failure (i.e. when the process just stopped running).
|
||||||
int timeout = m_processFailures < 10 ? m_processFailures : 10;
|
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);
|
ARCH->sleep(timeout);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -225,6 +225,9 @@ void MSWindowsWatchdog::mainLoop(void *)
|
||||||
if (startNeeded) {
|
if (startNeeded) {
|
||||||
startProcess();
|
startProcess();
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
// prevent backoff when no command is set.
|
||||||
|
m_processFailures = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_processStarted && !isProcessRunning()) {
|
if (m_processStarted && !isProcessRunning()) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue