Removed restrictions on monitor timeouts

The monitor timeouts can now be larger than the monitor interval. This will
allow the combination of low monitoring intervals and large network timeouts.
If a network experiences some periodic lag, it is desirable to allow large
timeout values.
This commit is contained in:
Markus Makela
2016-02-18 21:08:36 +02:00
parent a947b33769
commit fec1ebe925
3 changed files with 45 additions and 54 deletions

View File

@ -2584,19 +2584,31 @@ int create_new_monitor(CONFIG_CONTEXT *context, CONFIG_CONTEXT *obj, HASHTABLE*
char *connect_timeout = config_get_value(obj->parameters, "backend_connect_timeout");
if (connect_timeout)
{
monitorSetNetworkTimeout(obj->element, MONITOR_CONNECT_TIMEOUT, atoi(connect_timeout));
if (!monitorSetNetworkTimeout(obj->element, MONITOR_CONNECT_TIMEOUT, atoi(connect_timeout)))
{
MXS_ERROR("Failed to set backend_connect_timeout");
error_count++;
}
}
char *read_timeout = config_get_value(obj->parameters, "backend_read_timeout");
if (read_timeout)
{
monitorSetNetworkTimeout(obj->element, MONITOR_READ_TIMEOUT, atoi(read_timeout));
if (!monitorSetNetworkTimeout(obj->element, MONITOR_READ_TIMEOUT, atoi(read_timeout)))
{
MXS_ERROR("Failed to set backend_read_timeout");
error_count++;
}
}
char *write_timeout = config_get_value(obj->parameters, "backend_write_timeout");
if (write_timeout)
{
monitorSetNetworkTimeout(obj->element, MONITOR_WRITE_TIMEOUT, atoi(write_timeout));
if (!monitorSetNetworkTimeout(obj->element, MONITOR_WRITE_TIMEOUT, atoi(write_timeout)))
{
MXS_ERROR("Failed to set backend_write_timeout");
error_count++;
}
}
/* get the servers to monitor */