From 5904ae418e51884150979e339c6fc0f0638c0421 Mon Sep 17 00:00:00 2001 From: Robert Habermeier Date: Wed, 16 Mar 2022 01:41:20 -0500 Subject: [PATCH] make more subsystems blocking, fix blocking subsystem spawning (#5133) * make more subsystems blocking * actually spawn blocking subsystems on their own threads --- .../overseer/overseer-gen/proc-macro/src/impl_builder.rs | 2 +- polkadot/node/overseer/src/lib.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/polkadot/node/overseer/overseer-gen/proc-macro/src/impl_builder.rs b/polkadot/node/overseer/overseer-gen/proc-macro/src/impl_builder.rs index f669519e8a..a1c9450c41 100644 --- a/polkadot/node/overseer/overseer-gen/proc-macro/src/impl_builder.rs +++ b/polkadot/node/overseer/overseer-gen/proc-macro/src/impl_builder.rs @@ -594,7 +594,7 @@ pub(crate) fn impl_task_kind(info: &OverseerInfo) -> proc_macro2::TokenStream { struct Blocking; impl TaskKind for Blocking { fn launch_task(spawner: &mut S, task_name: &'static str, subsystem_name: &'static str, future: BoxFuture<'static, ()>) { - spawner.spawn(task_name, Some(subsystem_name), future) + spawner.spawn_blocking(task_name, Some(subsystem_name), future) } } diff --git a/polkadot/node/overseer/src/lib.rs b/polkadot/node/overseer/src/lib.rs index dc44abc799..dec173747f 100644 --- a/polkadot/node/overseer/src/lib.rs +++ b/polkadot/node/overseer/src/lib.rs @@ -462,19 +462,19 @@ pub struct Overseer { #[subsystem(ApprovalDistributionMessage)] approval_distribution: ApprovalDistribution, - #[subsystem(no_dispatch, ApprovalVotingMessage)] + #[subsystem(no_dispatch, blocking, ApprovalVotingMessage)] approval_voting: ApprovalVoting, #[subsystem(GossipSupportMessage)] gossip_support: GossipSupport, - #[subsystem(no_dispatch, DisputeCoordinatorMessage)] + #[subsystem(no_dispatch, blocking, DisputeCoordinatorMessage)] dispute_coordinator: DisputeCoordinator, #[subsystem(no_dispatch, DisputeDistributionMessage)] dispute_distribution: DisputeDistribution, - #[subsystem(no_dispatch, ChainSelectionMessage)] + #[subsystem(no_dispatch, blocking, ChainSelectionMessage)] chain_selection: ChainSelection, /// External listeners waiting for a hash to be in the active-leave set.