Ensure candidate-backing and provisioner exit on missing Overseer (#6939)

This ensures that both subsystems exit when the Overseer has exited
because of some error.
This commit is contained in:
Bastian Köcher
2023-03-23 10:07:40 +01:00
committed by GitHub
parent 74e5b8c67b
commit c7b3352b79
4 changed files with 12 additions and 2 deletions
+4
View File
@@ -70,6 +70,10 @@ pub enum Error {
#[error(transparent)]
SubsystemError(#[from] SubsystemError),
#[fatal]
#[error(transparent)]
OverseerExited(SubsystemError),
}
/// Utility for eating top level errors and log them.
+2 -1
View File
@@ -199,7 +199,8 @@ async fn run_iteration<Context>(
}
}
from_overseer = ctx.recv().fuse() => {
match from_overseer? {
// Map the error to ensure that the subsystem exits when the overseer is gone.
match from_overseer.map_err(Error::OverseerExited)? {
FromOrchestra::Signal(OverseerSignal::ActiveLeaves(update)) => handle_active_leaves_update(
&mut *ctx,
update,