Skip to content

Commit

Permalink
keep active stats lock held (#32763)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffwashington authored Aug 10, 2023
1 parent eae455c commit c9f7cb5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion accounts-db/src/accounts_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7523,7 +7523,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 accounts-db/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 (hashes, hash_total, lamports_total) = (0..max_bin)
Expand Down Expand Up @@ -1114,7 +1114,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 c9f7cb5

Please sign in to comment.