@@ -236,25 +236,12 @@ impl<VoteClient: ForwardingClient, NonVoteClient: ForwardingClient>
236236 self . buffer_packet_batches ( packet_batches, tpu_vote_batch, bank) ;
237237
238238 // Drain the channel up to timeout
239- let timed_out = loop {
240- if now. elapsed ( ) >= TIMEOUT {
241- break true ;
242- }
239+ while now. elapsed ( ) < TIMEOUT {
243240 match self . receiver . try_recv ( ) {
244241 Ok ( ( packet_batches, tpu_vote_batch) ) => {
245242 self . buffer_packet_batches ( packet_batches, tpu_vote_batch, bank)
246243 }
247- Err ( _) => break false ,
248- }
249- } ;
250-
251- // If timeout was reached, prevent backup by draining all
252- // packets in the channel.
253- if timed_out {
254- warn ! ( "ForwardingStage is backed up, dropping packets" ) ;
255- while let Ok ( ( packet_batch, _) ) = self . receiver . try_recv ( ) {
256- self . metrics . dropped_on_timeout +=
257- packet_batch. iter ( ) . map ( |b| b. len ( ) ) . sum :: < usize > ( ) ;
244+ Err ( _) => break ,
258245 }
259246 }
260247
@@ -722,8 +709,6 @@ struct ForwardingStageMetrics {
722709 non_votes_dropped_on_data_budget : usize ,
723710 non_votes_forwarded : usize ,
724711 non_votes_dropped_on_send : usize ,
725-
726- dropped_on_timeout : usize ,
727712}
728713
729714impl ForwardingStageMetrics {
@@ -803,7 +788,6 @@ impl Default for ForwardingStageMetrics {
803788 non_votes_dropped_on_data_budget : 0 ,
804789 non_votes_forwarded : 0 ,
805790 non_votes_dropped_on_send : 0 ,
806- dropped_on_timeout : 0 ,
807791 }
808792 }
809793}
0 commit comments