From c9f7cb5b7ed3e2c8ee395460ecf93fb287846730 Mon Sep 17 00:00:00 2001 From: "Jeff Washington (jwash)" Date: Thu, 10 Aug 2023 08:56:00 -0700 Subject: [PATCH] keep active stats lock held (#32763) --- accounts-db/src/accounts_db.rs | 2 +- accounts-db/src/accounts_hash.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/accounts-db/src/accounts_db.rs b/accounts-db/src/accounts_db.rs index 6915b007dfbff6..80b0a40e92fb13 100644 --- a/accounts-db/src/accounts_db.rs +++ b/accounts-db/src/accounts_db.rs @@ -7523,7 +7523,7 @@ impl AccountsDb { config: &CalcAccountsHashConfig<'_>, filler_account_suffix: Option<&Pubkey>, ) -> Result, 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); diff --git a/accounts-db/src/accounts_hash.rs b/accounts-db/src/accounts_hash.rs index e1dd5bbe570628..3d17d174dea635 100644 --- a/accounts-db/src/accounts_hash.rs +++ b/accounts-db/src/accounts_hash.rs @@ -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(),