gfe-relnote: In BbrSender, always try to get a bandwidth sample even if packet.bytes_acked=0(i.e. packet has been removed from QuicUnackedPacketMap's inflight bytes). Protected by default true flag --gfe2_reloadable_flag_quic_always_get_bw_sample_when_acked. PiperOrigin-RevId: 242172355 Change-Id: I180592b64915cf213694b1e6d8e41ac561cb2454
diff --git a/quic/core/congestion_control/bbr_sender.cc b/quic/core/congestion_control/bbr_sender.cc index 5c9e9ea..9de79cd 100644 --- a/quic/core/congestion_control/bbr_sender.cc +++ b/quic/core/congestion_control/bbr_sender.cc
@@ -137,7 +137,9 @@ probe_rtt_skipped_if_similar_rtt_(false), probe_rtt_disabled_if_app_limited_(false), app_limited_since_last_probe_rtt_(false), - min_rtt_since_last_probe_rtt_(QuicTime::Delta::Infinite()) { + min_rtt_since_last_probe_rtt_(QuicTime::Delta::Infinite()), + always_get_bw_sample_when_acked_( + GetQuicReloadableFlag(quic_always_get_bw_sample_when_acked)) { if (stats_) { stats_->slowstart_count = 0; stats_->slowstart_start_time = QuicTime::Zero(); @@ -499,12 +501,19 @@ const AckedPacketVector& acked_packets) { QuicTime::Delta sample_min_rtt = QuicTime::Delta::Infinite(); for (const auto& packet : acked_packets) { - if (packet.bytes_acked == 0) { + if (!always_get_bw_sample_when_acked_ && packet.bytes_acked == 0) { // Skip acked packets with 0 in flight bytes when updating bandwidth. continue; } BandwidthSample bandwidth_sample = sampler_.OnPacketAcknowledged(now, packet.packet_number); + if (always_get_bw_sample_when_acked_ && + !bandwidth_sample.state_at_send.is_valid) { + // From the sampler's perspective, the packet has never been sent, or the + // packet has been acked or marked as lost previously. + continue; + } + last_sample_is_app_limited_ = bandwidth_sample.state_at_send.is_app_limited; has_non_app_limited_sample_ |= !bandwidth_sample.state_at_send.is_app_limited;
diff --git a/quic/core/congestion_control/bbr_sender.h b/quic/core/congestion_control/bbr_sender.h index 405300f..d01dbfe 100644 --- a/quic/core/congestion_control/bbr_sender.h +++ b/quic/core/congestion_control/bbr_sender.h
@@ -400,6 +400,9 @@ bool probe_rtt_disabled_if_app_limited_; bool app_limited_since_last_probe_rtt_; QuicTime::Delta min_rtt_since_last_probe_rtt_; + + // Latched value of --quic_always_get_bw_sample_when_acked. + const bool always_get_bw_sample_when_acked_; }; QUIC_EXPORT_PRIVATE std::ostream& operator<<(std::ostream& os,