mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 01:11:10 +00:00
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:
@@ -75,6 +75,10 @@ pub enum Error {
|
||||
|
||||
#[error(transparent)]
|
||||
SubsystemError(#[from] SubsystemError),
|
||||
|
||||
#[fatal]
|
||||
#[error(transparent)]
|
||||
OverseerExited(SubsystemError),
|
||||
}
|
||||
|
||||
/// Used by `get_onchain_disputes` to represent errors related to fetching on-chain disputes from the Runtime
|
||||
|
||||
@@ -144,7 +144,8 @@ async fn run_iteration<Context>(
|
||||
loop {
|
||||
futures::select! {
|
||||
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(update, per_relay_parent, inherent_delays),
|
||||
FromOrchestra::Signal(OverseerSignal::BlockFinalized(..)) => {},
|
||||
|
||||
Reference in New Issue
Block a user