From: Aleš Mrázek Date: Wed, 26 Jun 2024 04:38:41 +0000 (+0200) Subject: manager: run policy-loader with old config when instability detected X-Git-Tag: v6.0.8~6^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b08ec833a2a291095058378a2fcd1f26881778e4;p=thirdparty%2Fknot-resolver.git manager: run policy-loader with old config when instability detected --- diff --git a/manager/knot_resolver_manager/kres_manager.py b/manager/knot_resolver_manager/kres_manager.py index b22570ed5..81aa7d7e9 100644 --- a/manager/knot_resolver_manager/kres_manager.py +++ b/manager/knot_resolver_manager/kres_manager.py @@ -327,7 +327,7 @@ class KresManager: # pylint: disable=too-many-instance-attributes async def _instability_handler(self) -> None: if self._fix_counter.is_too_high(): logger.error( - "Already attempted to many times to fix system state. Refusing to try again and shutting down." + "Already attempted too many times to fix system state. Refusing to try again and shutting down." ) await self.forced_shutdown() return @@ -337,7 +337,9 @@ class KresManager: # pylint: disable=too-many-instance-attributes self._fix_counter.increase() await self._reload_system_state() logger.warning("Workers reloaded. Applying old config....") - await self.apply_config(self._config_store.get(), _noretry=True) + old_config = self._config_store.get() + await self.load_policy_rules(old_config, old_config) + await self.apply_config(old_config, _noretry=True) logger.warning(f"System stability hopefully renewed. Fix attempt counter is currently {self._fix_counter}") except BaseException: logger.error("Failed attempting to fix an error. Forcefully shutting down.", exc_info=True)