log on acct idx derefs below 0 (#27544)

This commit is contained in:
Jeff Washington (jwash) 2022-09-06 07:34:05 -07:00 committed by GitHub
parent ed132e75a9
commit 7b579771b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -277,7 +277,10 @@ impl<T: IndexValue> AccountMapEntryInner<T> {
if add {
self.ref_count.fetch_add(1, Ordering::Release);
} else {
self.ref_count.fetch_sub(1, Ordering::Release);
let previous = self.ref_count.fetch_sub(1, Ordering::Release);
if previous == 0 {
inc_new_counter_info!("accounts_index-deref_from_0", 1);
}
}
self.set_dirty(true);
}