No public description

PiperOrigin-RevId: 918424361
diff --git a/quiche/common/quiche_feature_flags_list.h b/quiche/common/quiche_feature_flags_list.h
index 7075419..b924898 100755
--- a/quiche/common/quiche_feature_flags_list.h
+++ b/quiche/common/quiche_feature_flags_list.h
@@ -42,7 +42,6 @@
 QUICHE_FLAG(bool, quiche_reloadable_flag_quic_enforce_immediate_goaway, false, true, "If true, QUIC will support sending immediate GOAWAYS and will refuse streams above the limit.")
 QUICHE_FLAG(bool, quiche_reloadable_flag_quic_enobufs_blocked, true, true, "If true, ENOBUFS socket errors are reported as socket blocked instead of socket failure.")
 QUICHE_FLAG(bool, quiche_reloadable_flag_quic_fin_before_completed_http_headers, false, true, "If true, close the connection with error if FIN is received before finish receiving the whole HTTP headers.")
-QUICHE_FLAG(bool, quiche_reloadable_flag_quic_fix_gap_filling_ack_logic, true, true, "If true, fix the gap filling ack logic in QuicAckFrame.")
 QUICHE_FLAG(bool, quiche_reloadable_flag_quic_fix_timeouts, true, true, "If true, postpone setting handshake timeout to infinite to handshake complete.")
 QUICHE_FLAG(bool, quiche_reloadable_flag_quic_include_datagrams_in_willing_to_write, false, false, "If true, checks for queued datagrams when determining if a connection is willing to write.")
 QUICHE_FLAG(bool, quiche_reloadable_flag_quic_maybe_copy_datagram_frames, false, true, "If true, maybe copy datagram frames in QuicUnackedPacketMap.")
diff --git a/quiche/quic/core/quic_received_packet_manager.cc b/quiche/quic/core/quic_received_packet_manager.cc
index 11bd357..d0efc44 100644
--- a/quiche/quic/core/quic_received_packet_manager.cc
+++ b/quiche/quic/core/quic_received_packet_manager.cc
@@ -291,30 +291,18 @@
     return;
   }
 
-  if (GetQuicReloadableFlag(quic_fix_gap_filling_ack_logic)) {
-    QUIC_RELOADABLE_FLAG_COUNT(quic_fix_gap_filling_ack_logic);
-    if (reordering_threshold_ > 0 && was_last_packet_missing_ &&
-        last_sent_largest_acked_.IsInitialized() &&
-        last_sent_largest_acked_ >= QuicPacketNumber(reordering_threshold_) &&
-        (last_received_packet_number <=
-         last_sent_largest_acked_ - reordering_threshold_)) {
-      if (reordering_threshold_ > 1) {
-        QUIC_RELOADABLE_FLAG_COUNT_N(quic_receive_ack_frequency, 7, 7);
-      }
-      // Ack immediately if the received packet number is less than or equal to
-      // largest acked - reordering threshold.
-      ack_timeout_ = now;
-      return;
+  if (reordering_threshold_ > 0 && was_last_packet_missing_ &&
+      last_sent_largest_acked_.IsInitialized() &&
+      last_sent_largest_acked_ >= QuicPacketNumber(reordering_threshold_) &&
+      (last_received_packet_number <=
+       last_sent_largest_acked_ - reordering_threshold_)) {
+    if (reordering_threshold_ > 1) {
+      QUIC_RELOADABLE_FLAG_COUNT_N(quic_receive_ack_frequency, 7, 7);
     }
-  } else {
-    if (reordering_threshold_ > 0 && was_last_packet_missing_ &&
-        last_sent_largest_acked_.IsInitialized() &&
-        last_received_packet_number < last_sent_largest_acked_) {
-      // Ack immediately if an ACK frame was sent with a larger
-      // largest acked than the newly received packet number.
-      ack_timeout_ = now;
-      return;
-    }
+    // Ack immediately if the received packet number is less than or equal to
+    // largest acked - reordering threshold.
+    ack_timeout_ = now;
+    return;
   }
 
   if (changed_to_ce_marked_) {
diff --git a/quiche/quic/core/quic_received_packet_manager_test.cc b/quiche/quic/core/quic_received_packet_manager_test.cc
index ffca6fa..8df2781 100644
--- a/quiche/quic/core/quic_received_packet_manager_test.cc
+++ b/quiche/quic/core/quic_received_packet_manager_test.cc
@@ -823,35 +823,7 @@
   CheckAckTimeout(clock_.ApproximateNow());
 }
 
-TEST_F(QuicReceivedPacketManagerTest, LegacyLogicIgnoresReorderingThreshold) {
-  SetQuicReloadableFlag(quic_fix_gap_filling_ack_logic, false);
-
-  // Setup a reordering threshold of 10.
-  QuicAckFrequencyFrame frame;
-  frame.sequence_number = 1;
-  frame.requested_max_ack_delay = kDelayedAckTime;
-  frame.ack_eliciting_threshold = 1000;
-  frame.reordering_threshold = 10;
-  received_manager_.OnAckFrequencyFrame(frame);
-
-  // Establish a baseline: We have ACKed up to 100.
-  RecordPacketReceipt(100, clock_.ApproximateNow());
-  received_manager_.GetUpdatedAckFrame(QuicTime::Zero());
-  received_manager_.ResetAckStates();  // last_sent_largest_acked_ = 100
-
-  // Receive Packet 95.
-  // Legacy Logic: Is 95 < 100? YES -> Immediate ACK.
-  // (New Logic would say: Gap is 5, Threshold is 10 -> Delay ACK).
-  RecordPacketReceipt(95, clock_.ApproximateNow());
-  MaybeUpdateAckTimeout(kInstigateAck, 95);
-
-  // Verify Immediate ACK (The inefficient legacy behavior).
-  CheckAckTimeout(clock_.ApproximateNow());
-}
-
 TEST_F(QuicReceivedPacketManagerTest, ReorderingThresholdTriggersImmediateAck) {
-  SetQuicReloadableFlag(quic_fix_gap_filling_ack_logic, true);
-
   QuicAckFrequencyFrame frame;
   frame.sequence_number = 1;
   frame.requested_max_ack_delay = kDelayedAckTime;
@@ -874,7 +846,6 @@
 
 TEST_F(QuicReceivedPacketManagerTest,
        ReorderingThresholdDelaysAckForRecentPackets) {
-  SetQuicReloadableFlag(quic_fix_gap_filling_ack_logic, true);
   QuicAckFrequencyFrame frame;
   frame.sequence_number = 1;
   frame.requested_max_ack_delay = kDelayedAckTime;
@@ -897,8 +868,6 @@
 }
 
 TEST_F(QuicReceivedPacketManagerTest, ReorderingThresholdUnderflowGuard) {
-  SetQuicReloadableFlag(quic_fix_gap_filling_ack_logic, true);
-
   QuicAckFrequencyFrame frame;
   frame.sequence_number = 1;
   frame.requested_max_ack_delay = kDelayedAckTime;
@@ -922,8 +891,6 @@
 }
 
 TEST_F(QuicReceivedPacketManagerTest, ReorderingThresholdOneTriggersAck) {
-  SetQuicReloadableFlag(quic_fix_gap_filling_ack_logic, true);
-
   QuicAckFrequencyFrame frame;
   frame.sequence_number = 1;
   frame.requested_max_ack_delay = kDelayedAckTime;
@@ -944,8 +911,6 @@
 
 TEST_F(QuicReceivedPacketManagerTest,
        ReorderingThresholdBoundaryPlusOneDelaysAck) {
-  SetQuicReloadableFlag(quic_fix_gap_filling_ack_logic, true);
-
   QuicAckFrequencyFrame frame;
   frame.sequence_number = 1;
   frame.requested_max_ack_delay = kDelayedAckTime;
@@ -966,8 +931,6 @@
 
 TEST_F(QuicReceivedPacketManagerTest,
        ReorderingThresholdUnderflowGuardsPacketZero) {
-  SetQuicReloadableFlag(quic_fix_gap_filling_ack_logic, true);
-
   QuicAckFrequencyFrame frame;
   frame.sequence_number = 1;
   frame.requested_max_ack_delay = kDelayedAckTime;
@@ -991,8 +954,6 @@
 
 TEST_F(QuicReceivedPacketManagerTest,
        ReorderingThresholdExactZeroBoundaryTriggersAck) {
-  SetQuicReloadableFlag(quic_fix_gap_filling_ack_logic, true);
-
   QuicAckFrequencyFrame frame;
   frame.sequence_number = 1;
   frame.requested_max_ack_delay = kDelayedAckTime;