MXS-1156: Disable heartbeat if value is set to 0
MXS-1156: Disable heartbeat if value is set to 0. A warning log is written in maxscale log file when heartbeat is not set.
This commit is contained in:
@ -3949,7 +3949,7 @@ int blr_handle_change_master(ROUTER_INSTANCE* router,
|
||||
{
|
||||
int h_val = (int)strtol(master_heartbeat, NULL, 10);
|
||||
|
||||
if (h_val <= 0 ||
|
||||
if (h_val < 0 ||
|
||||
(errno == ERANGE) ||
|
||||
h_val > BLR_HEARTBEAT_MAX_INTERVAL)
|
||||
{
|
||||
@ -3973,6 +3973,13 @@ int blr_handle_change_master(ROUTER_INSTANCE* router,
|
||||
}
|
||||
else
|
||||
{
|
||||
if (h_val == 0)
|
||||
{
|
||||
MXS_WARNING("%s: %s",
|
||||
router->service->name,
|
||||
"MASTER_HEARTBEAT_PERIOD has been set to 0 (disabled): "
|
||||
"a master network inactivity will not be handled.");
|
||||
}
|
||||
router->heartbeat = h_val;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user