Deprecate gfe2_reloadable_flag_quic_donot_check_amplification_limit_with_pending_timer_credit.
PiperOrigin-RevId: 433003598
diff --git a/quic/core/quic_connection.cc b/quic/core/quic_connection.cc
index 5387535..4715925 100644
--- a/quic/core/quic_connection.cc
+++ b/quic/core/quic_connection.cc
@@ -3234,12 +3234,15 @@
return packet_creator_.HasSoftMaxPacketLength();
}
- const bool donot_check_amplification_limit_with_pending_timer_credit =
- GetQuicReloadableFlag(
- quic_donot_check_amplification_limit_with_pending_timer_credit);
+ if (sent_packet_manager_.pending_timer_transmission_count() > 0) {
+ // Allow sending if there are pending tokens, which occurs when:
+ // 1) firing PTO,
+ // 2) bundling CRYPTO data with ACKs,
+ // 3) coalescing CRYPTO data of higher space.
+ return true;
+ }
- if (!donot_check_amplification_limit_with_pending_timer_credit &&
- LimitedByAmplificationFactor()) {
+ if (LimitedByAmplificationFactor()) {
// Server is constrained by the amplification restriction.
QUIC_CODE_COUNT(quic_throttled_by_amplification_limit);
QUIC_DVLOG(1) << ENDPOINT
@@ -3252,32 +3255,6 @@
return false;
}
- if (sent_packet_manager_.pending_timer_transmission_count() > 0) {
- // Allow sending if there are pending tokens, which occurs when:
- // 1) firing PTO,
- // 2) bundling CRYPTO data with ACKs,
- // 3) coalescing CRYPTO data of higher space.
- return true;
- }
-
- if (donot_check_amplification_limit_with_pending_timer_credit) {
- QUIC_RELOADABLE_FLAG_COUNT(
- quic_donot_check_amplification_limit_with_pending_timer_credit);
- if (LimitedByAmplificationFactor()) {
- // Server is constrained by the amplification restriction.
- QUIC_CODE_COUNT(quic_throttled_by_amplification_limit);
- QUIC_DVLOG(1)
- << ENDPOINT
- << "Constrained by amplification restriction to peer address "
- << default_path_.peer_address << " bytes received "
- << default_path_.bytes_received_before_address_validation
- << ", bytes sent"
- << default_path_.bytes_sent_before_address_validation;
- ++stats_.num_amplification_throttling;
- return false;
- }
- }
-
if (HandleWriteBlocked()) {
return false;
}
diff --git a/quic/core/quic_connection_test.cc b/quic/core/quic_connection_test.cc
index fb3c509..6c6e84b 100644
--- a/quic/core/quic_connection_test.cc
+++ b/quic/core/quic_connection_test.cc
@@ -15154,44 +15154,30 @@
// Verify ACK delay is 1ms.
EXPECT_EQ(clock_.Now() + kAlarmGranularity,
connection_.GetAckAlarm()->deadline());
- if (!GetQuicReloadableFlag(
- quic_donot_check_amplification_limit_with_pending_timer_credit)) {
- // ACK is not sent because of amplification limit throttled.
- EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _)).Times(0);
- } else {
- // ACK is not throttled by amplification limit, and SHLO is bundled. Also
- // HANDSHAKE packet gets coalesced.
- EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _)).Times(2);
- }
+ // ACK is not throttled by amplification limit, and SHLO is bundled. Also
+ // HANDSHAKE packet gets coalesced.
+ EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _)).Times(2);
// ACK alarm fires.
clock_.AdvanceTime(kAlarmGranularity);
connection_.GetAckAlarm()->Fire();
- if (GetQuicReloadableFlag(
- quic_donot_check_amplification_limit_with_pending_timer_credit)) {
- // Verify HANDSHAKE packet is coalesced with INITIAL ACK + SHLO.
- EXPECT_EQ(0x03030303u, writer_->final_bytes_of_last_packet());
- // Only the first packet in the coalesced packet has been processed,
- // verify SHLO is bundled with INITIAL ACK.
- EXPECT_EQ(1u, writer_->ack_frames().size());
- EXPECT_EQ(1u, writer_->crypto_frames().size());
- // Process the coalesced HANDSHAKE packet.
- ASSERT_TRUE(writer_->coalesced_packet() != nullptr);
- auto packet = writer_->coalesced_packet()->Clone();
- writer_->framer()->ProcessPacket(*packet);
- EXPECT_EQ(0u, writer_->ack_frames().size());
- EXPECT_EQ(1u, writer_->crypto_frames().size());
- ASSERT_TRUE(writer_->coalesced_packet() == nullptr);
- }
+ // Verify HANDSHAKE packet is coalesced with INITIAL ACK + SHLO.
+ EXPECT_EQ(0x03030303u, writer_->final_bytes_of_last_packet());
+ // Only the first packet in the coalesced packet has been processed,
+ // verify SHLO is bundled with INITIAL ACK.
+ EXPECT_EQ(1u, writer_->ack_frames().size());
+ EXPECT_EQ(1u, writer_->crypto_frames().size());
+ // Process the coalesced HANDSHAKE packet.
+ ASSERT_TRUE(writer_->coalesced_packet() != nullptr);
+ auto packet = writer_->coalesced_packet()->Clone();
+ writer_->framer()->ProcessPacket(*packet);
+ EXPECT_EQ(0u, writer_->ack_frames().size());
+ EXPECT_EQ(1u, writer_->crypto_frames().size());
+ ASSERT_TRUE(writer_->coalesced_packet() == nullptr);
// Received INITIAL 3.
EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _)).Times(AnyNumber());
ProcessCryptoPacketAtLevel(3, ENCRYPTION_INITIAL);
- if (!GetQuicReloadableFlag(
- quic_donot_check_amplification_limit_with_pending_timer_credit)) {
- EXPECT_FALSE(connection_.HasPendingAcks());
- } else {
- EXPECT_TRUE(connection_.HasPendingAcks());
- }
+ EXPECT_TRUE(connection_.HasPendingAcks());
}
// Regression test for b/216133388.
diff --git a/quic/core/quic_flags_list.h b/quic/core/quic_flags_list.h
index 96e0882..3d6f55e 100644
--- a/quic/core/quic_flags_list.h
+++ b/quic/core/quic_flags_list.h
@@ -17,8 +17,6 @@
QUIC_FLAG(FLAGS_quic_restart_flag_quic_testonly_default_false, false)
// A testonly restart flag that will always default to true.
QUIC_FLAG(FLAGS_quic_restart_flag_quic_testonly_default_true, true)
-// Donot check amplification limit if there is available pending_timer_transmission_count.
-QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_donot_check_amplification_limit_with_pending_timer_credit, true)
// If bytes in flight has dipped below 1.25*MaxBW in the last round, do not exit PROBE_UP due to excess queue buildup.
QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_bbr2_no_probe_up_exit_if_no_queue, true)
// If true, 1) NEW_TOKENs sent from a IETF QUIC session will include the cached network parameters proto, 2) A min_rtt received from a validated token will be used to set the initial rtt, 3) Enable bandwidth resumption for IETF QUIC when connection options BWRE or BWMX exists.