From c56ef3cc270dad2f2693a5c2e5e293d65c19e6e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Wed, 8 Aug 2018 09:14:38 +0300 Subject: [PATCH] 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. --- server/core/config.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/server/core/config.cc b/server/core/config.cc index 3e86b13d3..90e7da8d8 100644 --- a/server/core/config.cc +++ b/server/core/config.cc @@ -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)