From 4150f91ff0687268e094a58ab177a12d56e97114 Mon Sep 17 00:00:00 2001 From: wanghao Date: Tue, 16 Apr 2019 19:33:22 +0800 Subject: [PATCH] Fix the logic error in hostwd In each period, the pmon_grace_loops is reduced two. In fact, minus one is enough. Closes-Bug: #1824983 Signed-off-by: wanghao Change-Id: I38ad97be5554f320d3a6e7366e39afe518ae7a92 --- mtce/src/hostw/hostwHdlr.cpp | 2 +- mtce/src/hostw/scripts/hostwd.conf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mtce/src/hostw/hostwHdlr.cpp b/mtce/src/hostw/hostwHdlr.cpp index 4b26d2c3..e3af18e6 100644 --- a/mtce/src/hostw/hostwHdlr.cpp +++ b/mtce/src/hostw/hostwHdlr.cpp @@ -127,7 +127,7 @@ void hostw_service ( void ) ilog ("Did not receive expected message from PMON - first missed message\n"); } ctrl->pmon_grace_loops--; - if ( ctrl->pmon_grace_loops <= 2 ) + if ( ctrl->pmon_grace_loops ) { ilog ("Did not receive expected message from PMON - %d more missed messages allowed\n", ctrl->pmon_grace_loops); diff --git a/mtce/src/hostw/scripts/hostwd.conf b/mtce/src/hostw/scripts/hostwd.conf index 7a94a32e..9b487356 100755 --- a/mtce/src/hostw/scripts/hostwd.conf +++ b/mtce/src/hostw/scripts/hostwd.conf @@ -2,7 +2,7 @@ [config] ; Configuration hostwd_reboot_on_err = 1 ; host watchdog to reboot on detected failure -hostwd_failure_threshold = 5 ; number of # missed messages before action taken +hostwd_failure_threshold = 3 ; number of # missed messages before action taken hostwd_use_kern_wd = 1 ; use kernel /dev/watchdog as backup watchdog hostwd_console_path = /dev/console ; console on which to log extreme events, like ; notification of reboot