mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-31 08:41:02 +00:00
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: Andrei Sandu <andrei-mihail@parity.io>
This commit is contained in:
@@ -18,10 +18,22 @@
|
|||||||
|
|
||||||
use crate::scheduler;
|
use crate::scheduler;
|
||||||
use primitives::{CoreIndex, Id as ParaId};
|
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
|
/// Returns the claimqueue from the scheduler
|
||||||
pub fn claim_queue<T: scheduler::Config>() -> BTreeMap<CoreIndex, VecDeque<ParaId>> {
|
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()
|
scheduler::ClaimQueue::<T>::get()
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.map(|(core_index, entries)| {
|
.map(|(core_index, entries)| {
|
||||||
|
|||||||
Reference in New Issue
Block a user