Stop processing configuration after the first failure

If the configuration processing encounters an error at the object
construction stage, it needs to stop immediately. If another object
depends on the object that failed, it would also fail but in a very
confusing manner. Mainly this manifests itself as a missing reference to
the object which would cause misleading errors to be logged.
This commit is contained in:
Markus Mäkelä 2018-08-08 09:14:38 +03:00
parent 6e79e34dd7
commit c56ef3cc27
No known key found for this signature in database
GPG Key ID: 72D48FCE664F7B19

View File

@ -1542,6 +1542,16 @@ process_config_context(CONFIG_CONTEXT *context)
{
error_count += create_new_monitor(obj, monitored_servers);
}
if (error_count)
{
/**
* We need to stop creating objects after the first error since
* any objects that depend on the object that failed would fail in
* a very confusing manner.
*/
break;
}
}
if (error_count)