Browse Source

vote_worker apply slot metrics action regardless of decision (#7274)

Andrew Fitzgerald 3 months ago
parent
commit
9c47a0e9dc
1 changed files with 6 additions and 5 deletions
  1. 6 5
      core/src/banking_stage/vote_worker.rs

+ 6 - 5
core/src/banking_stage/vote_worker.rs

@@ -124,13 +124,14 @@ impl VoteWorker {
         let metrics_action = slot_metrics_tracker.check_leader_slot_boundary(decision.bank_start());
         let metrics_action = slot_metrics_tracker.check_leader_slot_boundary(decision.bank_start());
         slot_metrics_tracker.increment_make_decision_us(make_decision_us);
         slot_metrics_tracker.increment_make_decision_us(make_decision_us);
 
 
+        // Take metrics action before processing packets (potentially resetting the
+        // slot metrics tracker to the next slot) so that we don't count the
+        // packet processing metrics from the next slot towards the metrics
+        // of the previous slot
+        slot_metrics_tracker.apply_action(metrics_action);
+
         match decision {
         match decision {
             BufferedPacketsDecision::Consume(bank_start) => {
             BufferedPacketsDecision::Consume(bank_start) => {
-                // Take metrics action before consume packets (potentially resetting the
-                // slot metrics tracker to the next slot) so that we don't count the
-                // packet processing metrics from the next slot towards the metrics
-                // of the previous slot
-                slot_metrics_tracker.apply_action(metrics_action);
                 let (_, consume_buffered_packets_us) = measure_us!(self.consume_buffered_packets(
                 let (_, consume_buffered_packets_us) = measure_us!(self.consume_buffered_packets(
                     &bank_start,
                     &bank_start,
                     banking_stage_stats,
                     banking_stage_stats,