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.
This commit is contained in:
Bastian Köcher
2023-10-23 17:06:04 +02:00
committed by GitHub
parent 5ca909cc09
commit 676bacd729
+2 -2
View File
@@ -627,8 +627,8 @@ impl<T: Config> Pallet<T> {
if ValidatorGroups::<T>::decode_len().map_or(true, |l| l == 0) { if ValidatorGroups::<T>::decode_len().map_or(true, |l| l == 0) {
return return
} }
// If there exists a core, ensure we schedule at least one job onto it.
let n_lookahead = Self::claimqueue_lookahead(); let n_lookahead = Self::claimqueue_lookahead().max(1);
let n_session_cores = T::AssignmentProvider::session_core_count(); let n_session_cores = T::AssignmentProvider::session_core_count();
let cq = ClaimQueue::<T>::get(); let cq = ClaimQueue::<T>::get();
let ttl = <configuration::Pallet<T>>::config().on_demand_ttl; let ttl = <configuration::Pallet<T>>::config().on_demand_ttl;