[control] Fix round 4: a device change during an engine switch is never skipped silently (devices_problem until the serving engine is told), and every switch ends by telling the engine that serves, also after going back

This commit is contained in:
2026-11-08 12:48:57 +01:00
parent c45dafa2a3
commit 0213021bb1
4 changed files with 60 additions and 22 deletions
+11
View File
@@ -254,6 +254,17 @@ impl Control {
});
}
}
// Still under the engine lock: whichever engine serves now reads the device files again
// (QC round 4). A device change during the switch only wrote them; a Caddy that was
// already running, or started before they changed, would keep the old list.
if self.pki.is_some()
&& let Err(e) = self.nudge_devices().await
{
log::error!(target: "ianitor::engine", "after the switch: {e}; retrying");
if let Ok(mut p) = self.devices_problem.lock() {
*p = Some(e);
}
}
}
fn units_and_cfg(&self) -> Result<(Arc<dyn Units>, EngineConfig), String> {