Fix number of allowed missed messages from pmon in hostwd

The following commit attempted to fix failure logic in hostwd:
4150f91ff0
hostwd_failure_threshold has been reduced from 5 to 3 in it, but the
logic around pmon_grace_loops hasn't been touched.
hostwd_failure_threshold is still reduced by 2 every time we miss a
message from pmon. So, we only allow 1 missed message before the reboot.
Removing this double substraction and reverting to old beavior:
allow 2 missed messages from PMON and reboot a system on a 3rd one.

Closes-Bug: 1824983
Change-Id: I57293f9383302d042faee78189409043e21b5801
Signed-off-by: Alex Kozyrev <alex.kozyrev@windriver.com>
(cherry picked from commit 8f9decd6e5)
This commit is contained in:
Alex Kozyrev 2019-08-08 15:26:08 -04:00
parent 7bc66b0cb2
commit 7ffbe49712
1 changed files with 2 additions and 8 deletions

View File

@ -73,7 +73,7 @@ void hostw_service ( void )
hostw_ctrl_type *ctrl = get_ctrl_ptr ();
daemon_config_type *config = daemon_get_cfg_ptr ();
ctrl->pmon_grace_loops = config->hostwd_failure_threshold + 1;
ctrl->pmon_grace_loops = config->hostwd_failure_threshold;
socks.clear();
if ( hostw_socket->status_sock )
@ -121,16 +121,10 @@ void hostw_service ( void )
{
ctrl->pmon_grace_loops--;
/* we missed a message from PMON */
if ( ctrl->pmon_grace_loops == (config->hostwd_failure_threshold - 1) )
{
ilog ("Did not receive expected message from PMON - first missed message\n");
}
ctrl->pmon_grace_loops--;
if ( ctrl->pmon_grace_loops )
{
ilog ("Did not receive expected message from PMON - %d more missed messages allowed\n",
ctrl->pmon_grace_loops);
ctrl->pmon_grace_loops-1);
}
}
}