Deprecate --gfe2_reloadable_flag_quic_bbr_default_exit_startup_on_loss.

PiperOrigin-RevId: 317682056
Change-Id: I12ff1fad1d94be3ce7cfe6055d473bfc1057de17
diff --git a/quic/core/congestion_control/bbr_sender.cc b/quic/core/congestion_control/bbr_sender.cc
index 34c81cd..6c6f3ef 100644
--- a/quic/core/congestion_control/bbr_sender.cc
+++ b/quic/core/congestion_control/bbr_sender.cc
@@ -32,10 +32,6 @@
 const float kDerivedHighGain = 2.773f;
 // The newly derived CWND gain for STARTUP, 2.
 const float kDerivedHighCWNDGain = 2.0f;
-// The gain used in STARTUP after loss has been detected.
-// 1.5 is enough to allow for 25% exogenous loss and still observe a 25% growth
-// in measured bandwidth.
-const float kStartupAfterLossGain = 1.5f;
 // The cycle of gains used during the PROBE_BW stage.
 const float kPacingGain[] = {1.25, 0.75, 1, 1, 1, 1, 1, 1};
 
@@ -106,8 +102,6 @@
       congestion_window_gain_constant_(
           static_cast<float>(GetQuicFlag(FLAGS_quic_bbr_cwnd_gain))),
       num_startup_rtts_(kRoundTripsWithoutGrowthBeforeExitingStartup),
-      exit_startup_on_loss_(
-          GetQuicReloadableFlag(quic_bbr_default_exit_startup_on_loss)),
       cycle_current_offset_(0),
       last_cycle_start_(QuicTime::Zero()),
       is_at_full_bandwidth_(false),
@@ -138,10 +132,7 @@
     stats_->slowstart_duration = QuicTimeAccumulator();
   }
   EnterStartupMode(now);
-  if (exit_startup_on_loss_) {
-    QUIC_RELOADABLE_FLAG_COUNT(quic_bbr_default_exit_startup_on_loss);
-    set_high_cwnd_gain(kDerivedHighCWNDGain);
-  }
+  set_high_cwnd_gain(kDerivedHighCWNDGain);
 }
 
 BbrSender::~BbrSender() {}
@@ -203,14 +194,8 @@
     return ProbeRttCongestionWindow();
   }
 
-  if (exit_startup_on_loss_) {
-    if (InRecovery()) {
-      return std::min(congestion_window_, recovery_window_);
-    }
-  } else {
-    if (InRecovery() && !(rate_based_startup_ && mode_ == STARTUP)) {
-      return std::min(congestion_window_, recovery_window_);
-    }
+  if (InRecovery()) {
+    return std::min(congestion_window_, recovery_window_);
   }
 
   return congestion_window_;
@@ -265,17 +250,9 @@
   if (config.HasClientRequestedIndependentOption(k2RTT, perspective)) {
     num_startup_rtts_ = 2;
   }
-  if (!exit_startup_on_loss_ &&
-      config.HasClientRequestedIndependentOption(kBBRS, perspective)) {
-    slower_startup_ = true;
-  }
   if (config.HasClientRequestedIndependentOption(kBBR3, perspective)) {
     drain_to_target_ = true;
   }
-  if (!exit_startup_on_loss_ &&
-      config.HasClientRequestedIndependentOption(kBBS1, perspective)) {
-    rate_based_startup_ = true;
-  }
   if (GetQuicReloadableFlag(quic_bbr_mitigate_overly_large_bandwidth_sample)) {
     if (config.HasClientRequestedIndependentOption(kBWM3, perspective)) {
       bytes_lost_multiplier_with_network_parameters_adjusted_ = 3;
@@ -321,14 +298,7 @@
 }
 
 void BbrSender::ApplyConnectionOptions(
-    const QuicTagVector& connection_options) {
-  if (ContainsQuicTag(connection_options, kLRTT)) {
-    exit_startup_on_loss_ = true;
-  }
-  if (ContainsQuicTag(connection_options, kBBQ2)) {
-    set_high_cwnd_gain(kDerivedHighCWNDGain);
-  }
-}
+    const QuicTagVector& /*connection_options*/) {}
 
 void BbrSender::AdjustNetworkParameters(const NetworkParams& params) {
   const QuicBandwidth& bandwidth = params.bandwidth;
@@ -672,10 +642,6 @@
 
 bool BbrSender::ShouldExitStartupDueToLoss(
     const SendTimeState& last_packet_send_state) const {
-  if (!exit_startup_on_loss_) {
-    return false;
-  }
-
   if (num_loss_events_in_round_ <
           GetQuicFlag(FLAGS_quic_bbr2_default_startup_full_loss_count) ||
       !last_packet_send_state.is_valid) {
@@ -746,7 +712,7 @@
                                     bool has_losses,
                                     bool is_round_start) {
   // Disable recovery in startup, if loss-based exit is enabled.
-  if (exit_startup_on_loss_ && !is_at_full_bandwidth_) {
+  if (!is_at_full_bandwidth_) {
     return;
   }
 
@@ -840,16 +806,6 @@
     }
   }
 
-  if (!exit_startup_on_loss_) {
-    // Slow the pacing rate in STARTUP once loss has ever been detected.
-    const bool has_ever_detected_loss = end_recovery_at_.IsInitialized();
-    if (slower_startup_ && has_ever_detected_loss &&
-        has_non_app_limited_sample_) {
-      pacing_rate_ = kStartupAfterLossGain * BandwidthEstimate();
-      return;
-    }
-  }
-
   // Do not decrease the pacing rate during startup.
   pacing_rate_ = std::max(pacing_rate_, target_rate);
 }
@@ -895,10 +851,6 @@
 
 void BbrSender::CalculateRecoveryWindow(QuicByteCount bytes_acked,
                                         QuicByteCount bytes_lost) {
-  if (!exit_startup_on_loss_ && rate_based_startup_ && mode_ == STARTUP) {
-    return;
-  }
-
   if (recovery_state_ == NOT_IN_RECOVERY) {
     return;
   }
diff --git a/quic/core/congestion_control/bbr_sender.h b/quic/core/congestion_control/bbr_sender.h
index c7285d7..446f0dd 100644
--- a/quic/core/congestion_control/bbr_sender.h
+++ b/quic/core/congestion_control/bbr_sender.h
@@ -326,13 +326,6 @@
   // The number of RTTs to stay in STARTUP mode.  Defaults to 3.
   QuicRoundTripCount num_startup_rtts_;
 
-  // Latched value of --quic_bbr_default_exit_startup_on_loss.
-  // If true, exit startup if all of the following conditions are met:
-  // - 1RTT has passed with no bandwidth increase,
-  // - Some number of congestion events happened with loss, in the last round.
-  // - Some amount of inflight bytes (at the start of the last round) are lost.
-  bool exit_startup_on_loss_;
-
   // Number of round-trips in PROBE_BW mode, used for determining the current
   // pacing gain cycle.
   int cycle_current_offset_;
diff --git a/quic/core/congestion_control/bbr_sender_test.cc b/quic/core/congestion_control/bbr_sender_test.cc
index 92aef73..8855918 100644
--- a/quic/core/congestion_control/bbr_sender_test.cc
+++ b/quic/core/congestion_control/bbr_sender_test.cc
@@ -617,17 +617,10 @@
   EXPECT_APPROX_EQ(sender_->BandwidthEstimate() * (1 / 2.885f),
                    sender_->PacingRate(0), 0.01f);
 
-  if (!GetQuicReloadableFlag(quic_bbr_default_exit_startup_on_loss)) {
-    // BBR uses CWND gain of 2.88 during STARTUP, hence it will fill the buffer
-    // with approximately 1.88 BDPs.  Here, we use 1.5 to give some margin for
-    // error.
-    EXPECT_GE(queue->bytes_queued(), 1.5 * kTestBdp);
-  } else {
-    // BBR uses CWND gain of 2 during STARTUP, hence it will fill the buffer
-    // with approximately 1 BDP.  Here, we use 0.8 to give some margin for
-    // error.
-    EXPECT_GE(queue->bytes_queued(), 0.8 * kTestBdp);
-  }
+  // BBR uses CWND gain of 2 during STARTUP, hence it will fill the buffer
+  // with approximately 1 BDP.  Here, we use 0.8 to give some margin for
+  // error.
+  EXPECT_GE(queue->bytes_queued(), 0.8 * kTestBdp);
 
   // Observe increased RTT due to bufferbloat.
   const QuicTime::Delta queueing_delay =
@@ -885,9 +878,6 @@
 TEST_F(BbrSenderTest, SimpleTransferExitStartupOnLoss) {
   CreateDefaultSetup();
 
-  if (!GetQuicReloadableFlag(quic_bbr_default_exit_startup_on_loss)) {
-    SetConnectionOption(kLRTT);
-  }
   EXPECT_EQ(3u, sender_->num_startup_rtts());
 
   // Run until the full bandwidth is reached and check how many rounds it was.
@@ -915,9 +905,6 @@
 TEST_F(BbrSenderTest, SimpleTransferExitStartupOnLossSmallBuffer) {
   CreateSmallBufferSetup();
 
-  if (!GetQuicReloadableFlag(quic_bbr_default_exit_startup_on_loss)) {
-    SetConnectionOption(kLRTT);
-  }
   EXPECT_EQ(3u, sender_->num_startup_rtts());
 
   // Run until the full bandwidth is reached and check how many rounds it was.
@@ -971,9 +958,6 @@
 TEST_F(BbrSenderTest, DerivedCWNDGainStartup) {
   CreateSmallBufferSetup();
 
-  if (!GetQuicReloadableFlag(quic_bbr_default_exit_startup_on_loss)) {
-    SetConnectionOption(kBBQ2);
-  }
   EXPECT_EQ(3u, sender_->num_startup_rtts());
   // Verify that Sender is in slow start.
   EXPECT_TRUE(sender_->InSlowStart());