Skip to content

Commit

Permalink
keep active stats lock held
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffwashington committed Aug 8, 2023
1 parent ef318c2 commit 2c02229
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion runtime/src/accounts_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7476,7 +7476,7 @@ impl AccountsDb {
config: &CalcAccountsHashConfig<'_>,
filler_account_suffix: Option<&Pubkey>,
) -> Result<Vec<CacheHashDataFile>, AccountsHashVerificationError> {
let _ = self.active_stats.activate(ActiveStatItem::HashScan);
let _guard = self.active_stats.activate(ActiveStatItem::HashScan);

let bin_calculator = PubkeyBinCalculator24::new(bins);
assert!(bin_range.start < bins && bin_range.end <= bins && bin_range.start < bin_range.end);
Expand Down
4 changes: 2 additions & 2 deletions runtime/src/accounts_hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -782,7 +782,7 @@ impl<'a> AccountsHasher<'a> {
// a. vec: PUBKEY_BINS_FOR_CALCULATING_HASHES in pubkey order
// vec: individual hashes in pubkey order, 1 hash per
// b. lamports
let _ = self.active_stats.activate(ActiveStatItem::HashDeDup);
let _guard = self.active_stats.activate(ActiveStatItem::HashDeDup);

let mut zeros = Measure::start("eliminate zeros");
let sum = Mutex::new(0u64);
Expand Down Expand Up @@ -1089,7 +1089,7 @@ impl<'a> AccountsHasher<'a> {

let cumulative = CumulativeHashesFromFiles::from_files(hashes);

let _ = self.active_stats.activate(ActiveStatItem::HashMerkleTree);
let _guard = self.active_stats.activate(ActiveStatItem::HashMerkleTree);
let mut hash_time = Measure::start("hash");
let (hash, _) = Self::compute_merkle_root_from_slices(
cumulative.total_count(),
Expand Down

0 comments on commit 2c02229

Please sign in to comment.