keep active stats lock held (#32763)

This commit is contained in:
Jeff Washington (jwash) 2023-08-10 08:56:00 -07:00 committed by GitHub
parent eae455c34b
commit c9f7cb5b7e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -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);

View File

@ -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)
@ -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(),