Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Commit

Permalink
Assert there's no active scheduler before freezing
Browse files Browse the repository at this point in the history
  • Loading branch information
ryoqun committed Apr 23, 2023
1 parent 3ba582b commit 9769288
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions runtime/src/bank.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1475,6 +1475,10 @@ impl Bank {
let mut time = Measure::start("bank::new_from_parent");
let NewBankOptions { vote_only_bank } = new_bank_options;

// there should be no active scheduler at this point, which
// might be actively mutating bank state...
assert!(!parent.with_scheduler());

parent.freeze();
assert_ne!(slot, parent.slot());

Expand Down

0 comments on commit 9769288

Please sign in to comment.