Unifies logging of start/stop for background services (#30916)

This commit is contained in:
Brooks 2023-03-28 08:32:18 -04:00 committed by GitHub
parent 2cefbd1dfd
commit d7ae05c3fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 5 deletions

View File

@ -61,6 +61,7 @@ impl AccountsHashVerifier {
let t_accounts_hash_verifier = Builder::new()
.name("solAcctHashVer".to_string())
.spawn(move || {
info!("AccountsHashVerifier has started");
let mut hashes = vec![];
loop {
if exit.load(Ordering::Relaxed) {
@ -109,7 +110,7 @@ impl AccountsHashVerifier {
("handling-time-us", handling_time_us, i64),
);
}
info!("Accounts Hash Verifier has stopped");
info!("AccountsHashVerifier has stopped");
})
.unwrap();
Self {

View File

@ -57,6 +57,7 @@ impl SnapshotPackagerService {
let t_snapshot_packager = Builder::new()
.name("solSnapshotPkgr".to_string())
.spawn(move || {
info!("SnapshotPackagerService has started");
renice_this_thread(snapshot_config.packager_thread_niceness_adj).unwrap();
let mut snapshot_gossip_manager = enable_gossip_push.then(||
SnapshotGossipManager::new(
@ -122,7 +123,7 @@ impl SnapshotPackagerService {
("handling-time-us", handling_time_us, i64),
);
}
info!("Snapshot Packager Service has stopped");
info!("SnapshotPackagerService has stopped");
})
.unwrap();

View File

@ -533,7 +533,6 @@ impl AccountsBackgroundService {
test_hash_calculation: bool,
mut last_full_snapshot_slot: Option<Slot>,
) -> Self {
info!("AccountsBackgroundService active");
let exit = exit.clone();
let mut last_cleaned_block_height = 0;
let mut removed_slots_count = 0;
@ -542,6 +541,7 @@ impl AccountsBackgroundService {
let t_background = Builder::new()
.name("solBgAccounts".to_string())
.spawn(move || {
info!("AccountsBackgroundService has started");
let mut stats = StatsManager::new();
let mut last_snapshot_end_time = None;
@ -656,12 +656,14 @@ impl AccountsBackgroundService {
stats.record_and_maybe_submit(start_time.elapsed());
sleep(Duration::from_millis(INTERVAL_MS));
}
info!(
"ABS loop done. Number of snapshot storages kept alive for fastboot: {}",
debug!(
"Storages kept alive for fastboot: {}",
last_snapshot_storages
.as_ref()
.map(|storages| storages.len())
.unwrap_or(0)
);
info!("AccountsBackgroundService has stopped");
})
.unwrap();