err_res = filter(lambda r: r.is_err(), results)
errs = list(map(lambda r: r.unwrap_err(), err_res))
if len(errs) > 0:
- raise KresManagerException(
- "Validation of the new config failed. The reasons are:\n - " + "\n - ".join(errs)
- )
+ raise KresManagerException("Configuration validation failed. The reasons are:\n - " + "\n - ".join(errs))
async with self._update_lock:
# update the stored config with the new version
for call in self._callbacks:
await call(config)
+ async def renew(self) -> None:
+ await self.update(self._config)
+
async def register_verifier(self, verifier: VerifyCallback) -> None:
self._verifiers.append(verifier)
res = await verifier(self.get(), self.get())
self._fix_counter.increase()
await self._reload_system_state()
logger.warning("Workers reloaded. Applying old config....")
- old_config = self._config_store.get()
- await self.load_policy_rules(old_config, old_config)
- await self.apply_config(old_config, _noretry=True)
+ await self._config_store.renew()
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)