fn run_responses_listener(
        ancestor_hashes_request_statuses: Arc<DashMap<Slot, DeadSlotAncestorRequestStatus>>,
        response_receiver: PacketReceiver,
        blockstore: Arc<Blockstore>,
        outstanding_requests: Arc<RwLock<OutstandingAncestorHashesRepairs>>,
        exit: Arc<AtomicBool>,
        duplicate_slots_reset_sender: DuplicateSlotsResetSender,
    ) -> JoinHandle<()> {
        Builder::new()
            .name("solana-ancestor-hashes-responses-service".to_string())
            .spawn(move || {
                let mut last_stats_report = Instant::now();
                let mut stats = AncestorHashesResponsesStats::default();
                let mut max_packets = 1024;
                loop {
                    let result = Self::process_new_responses(
                        &ancestor_hashes_request_statuses,
                        &response_receiver,
                        &blockstore,
                        &outstanding_requests,
                        &mut stats,
                        &mut max_packets,
                        &duplicate_slots_reset_sender,
                    );
                    match result {
                        Err(Error::RecvTimeout(_)) | Ok(_) => {}
                        Err(err) => info!("ancestors hashes reponses listener error: {:?}", err),
                    };
                    if exit.load(Ordering::Relaxed) {
                        return;
                    }
                    if last_stats_report.elapsed().as_secs() > 2 {
                        stats.report();
                        last_stats_report = Instant::now();
                    }
                }
            })
            .unwrap()
    }
/// Listen for responses to our ancestors hashes repair requests
Listen for responses to our ancestors hashes repair requests
Listen for responses to our ancestors hashes repair requests
fn run_responses_listener(
        ancestor_hashes_request_statuses: Arc<DashMap<Slot, DeadSlotAncestorRequestStatus>>,
        response_receiver: PacketReceiver,
        blockstore: Arc<Blockstore>,
        outstanding_requests: Arc<RwLock<OutstandingAncestorHashesRepairs>>,
        exit: Arc<AtomicBool>,
        duplicate_slots_reset_sender: DuplicateSlotsResetSender,
    ) -> JoinHandle<()> {
        Builder::new()
            .name("solana-ancestor-hashes-responses-service".to_string())
            .spawn(move || {
                let mut last_stats_report = Instant::now();
                let mut stats = AncestorHashesResponsesStats::default();
                let mut max_packets = 1024;
                loop {
                    let result = Self::process_new_responses(
                        &ancestor_hashes_request_statuses,
                        &response_receiver,
                        &blockstore,
                        &outstanding_requests,
                        &mut stats,
                        &mut max_packets,
                        &duplicate_slots_reset_sender,
                    );
                    match result {
                        Err(Error::RecvTimeout(_)) | Ok(_) => {}
                        Err(err) => info!("ancestors hashes reponses listener error: {:?}", err),
                    };
                    if exit.load(Ordering::Relaxed) {
                        return;
                    }
                    if last_stats_report.elapsed().as_secs() > 2 {
                        stats.report();
                        last_stats_report = Instant::now();
                    }
                }
            })
            .unwrap()
    }
fn run_responses_listener ( ancestor_hashes_request_statuses : Arc < DashMap < Slot , DeadSlotAncestorRequestStatus > > , response_receiver : PacketReceiver , blockstore : Arc < Blockstore > , outstanding_requests : Arc < RwLock < OutstandingAncestorHashesRepairs > > , exit : Arc < AtomicBool > , duplicate_slots_reset_sender : DuplicateSlotsResetSender , ) -> JoinHandle < ( ) > { Builder :: new ( ) . name ( " " . to_string ( ) ) . spawn ( move | | { let mut last_stats_report = Instant :: now ( ) ; let mut stats = AncestorHashesResponsesStats :: default ( ) ; let mut max_packets = 1024 ; loop { let result = Self :: process_new_responses ( & ancestor_hashes_request_statuses , & response_receiver , & blockstore , & outstanding_requests , & mut stats , & mut max_packets , & duplicate_slots_reset_sender , ) ; match result { Err ( Error :: RecvTimeout ( _ ) ) | Ok ( _ ) => { } Err ( err ) => info ! ( " " err ) , } ; if exit . load ( Ordering :: Relaxed ) { return ; } if last_stats_report . elapsed ( ) . as_secs ( ) > 2 { stats . report ( ) ; last_stats_report = Instant :: now ( ) ; } } } ) . unwrap ( ) }
Listen for responses to our ancestors hashes repair requests
Listen for responses to our ancestors hashes repair requests
ancestor_hashes_request_statuses
Arc<DashMap<Slot, DeadSlotAncestorRequestStatus>>
response_receiver
PacketReceiver
blockstore
Arc<Blockstore>
outstanding_requests
Arc<RwLock<OutstandingAncestorHashesRepairs>>
exit
Arc<AtomicBool>
duplicate_slots_reset_sender
DuplicateSlotsResetSender
ancestor_hashes_request_statuses
Arc<DashMap<Slot, DeadSlotAncestorRequestStatus>>
response_receiver
PacketReceiver
blockstore
Arc<Blockstore>
outstanding_requests
Arc<RwLock<OutstandingAncestorHashesRepairs>>
exit
Arc<AtomicBool>
duplicate_slots_reset_sender
DuplicateSlotsResetSender