report udp stats from validator (backport #20587) (#20799)

* report udp stats from validator (#20587)

(cherry picked from commit 4cac66244d)

# Conflicts:
#	core/src/validator.rs

* resolve merge conflicts

Co-authored-by: Jeff Biseda <jbiseda@gmail.com>
This commit is contained in:
mergify[bot]
2021-10-20 00:57:38 +00:00
committed by GitHub
parent 564cc95b00
commit 436ec212f4
3 changed files with 243 additions and 0 deletions

View File

@@ -14,6 +14,7 @@ use {
serve_repair_service::ServeRepairService,
sigverify,
snapshot_packager_service::{PendingSnapshotPackage, SnapshotPackagerService},
system_monitor_service::{verify_udp_stats_access, SystemMonitorService},
tpu::{Tpu, DEFAULT_TPU_COALESCE_MS},
tvu::{Sockets, Tvu, TvuConfig},
},
@@ -262,6 +263,7 @@ pub struct Validator {
transaction_status_service: Option<TransactionStatusService>,
rewards_recorder_service: Option<RewardsRecorderService>,
cache_block_meta_service: Option<CacheBlockMetaService>,
system_monitor_service: Option<SystemMonitorService>,
sample_performance_service: Option<SamplePerformanceService>,
gossip_service: GossipService,
serve_repair_service: ServeRepairService,
@@ -430,6 +432,12 @@ impl Validator {
*start_progress.write().unwrap() = ValidatorStartProgress::StartingServices;
verify_udp_stats_access().unwrap_or_else(|err| {
error!("Failed to access UDP stats: {}", err);
abort();
});
let system_monitor_service = Some(SystemMonitorService::new(Arc::clone(&exit)));
let leader_schedule_cache = Arc::new(leader_schedule_cache);
let bank = bank_forks.working_bank();
if let Some(ref shrink_paths) = config.account_shrink_paths {
@@ -841,6 +849,7 @@ impl Validator {
transaction_status_service,
rewards_recorder_service,
cache_block_meta_service,
system_monitor_service,
sample_performance_service,
snapshot_packager_service,
completed_data_sets_service,
@@ -931,6 +940,12 @@ impl Validator {
.expect("cache_block_meta_service");
}
if let Some(system_monitor_service) = self.system_monitor_service {
system_monitor_service
.join()
.expect("system_monitor_service");
}
if let Some(sample_performance_service) = self.sample_performance_service {
sample_performance_service
.join()