Skip to content
Snippets Groups Projects
Unverified Commit 69cc7f20 authored by Andrei Sandu's avatar Andrei Sandu Committed by GitHub
Browse files

Fix ClaimQueue case of nothing scheduled on session boundary (#4065)


Same issue but about av-cores was fixed in
https://github.com/paritytech/polkadot-sdk/pull/1403

Signed-off-by: default avatarAndrei Sandu <andrei-mihail@parity.io>
parent 643aa2be
No related merge requests found
Pipeline #464601 passed with stages
in 1 hour, 19 minutes, and 56 seconds
......@@ -18,10 +18,22 @@
use crate::scheduler;
use primitives::{CoreIndex, Id as ParaId};
use sp_std::collections::{btree_map::BTreeMap, vec_deque::VecDeque};
use sp_runtime::traits::One;
use sp_std::{
collections::{btree_map::BTreeMap, vec_deque::VecDeque},
vec::Vec,
};
/// Returns the claimqueue from the scheduler
pub fn claim_queue<T: scheduler::Config>() -> BTreeMap<CoreIndex, VecDeque<ParaId>> {
let now = <frame_system::Pallet<T>>::block_number() + One::one();
// This explicit update is only strictly required for session boundaries:
//
// At the end of a session we clear the claim queues: Without this update call, nothing would be
// scheduled to the client.
<scheduler::Pallet<T>>::free_cores_and_fill_claimqueue(Vec::new(), now);
scheduler::ClaimQueue::<T>::get()
.into_iter()
.map(|(core_index, entries)| {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment