From 676bacd7299826fb0ea88055d2108f3c6a734291 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20K=C3=B6cher?= Date: Mon, 23 Oct 2023 17:06:04 +0200 Subject: [PATCH] Always schedule at least one job onto a core (#1990) Even if the host configuration is returning `0` for the `lookahead`, we should schedule at least one job on a core if the core exists. --- polkadot/runtime/parachains/src/scheduler.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/polkadot/runtime/parachains/src/scheduler.rs b/polkadot/runtime/parachains/src/scheduler.rs index af48019124de..f3333d5cf857 100644 --- a/polkadot/runtime/parachains/src/scheduler.rs +++ b/polkadot/runtime/parachains/src/scheduler.rs @@ -627,8 +627,8 @@ impl Pallet { if ValidatorGroups::::decode_len().map_or(true, |l| l == 0) { return } - - let n_lookahead = Self::claimqueue_lookahead(); + // If there exists a core, ensure we schedule at least one job onto it. + let n_lookahead = Self::claimqueue_lookahead().max(1); let n_session_cores = T::AssignmentProvider::session_core_count(); let cq = ClaimQueue::::get(); let ttl = >::config().on_demand_ttl;