BWE reset for probing. (#3295)

This commit is contained in:
Raja Subramanian authored and GitHub committed 2024-12-31 23:22:47 +05:30
1 parent ac43e8a640
commit 238333985b
1 file changed
+7 -2
+7 -2
View File
@@ -688,12 +688,15 @@ func (s *StreamAllocator) handleSignalFeedback(event Event) {
}
func (s *StreamAllocator) handleSignalPeriodicPing(Event) {
// if pause is allowed, there may be no packets sent and BWE could be congested state,
// if pause is allowed, there may be no packets sent and BWE could be in congested state,
// reset BWE if that persists for a while
if s.state == streamAllocatorStateDeficient && s.params.Pacer.TimeSinceLastSentPacket() > s.params.Config.PausedMinWait {
if s.allowPause && s.state == streamAllocatorStateDeficient && s.params.BWE.CongestionState() != bwe.CongestionStateNone && s.params.Pacer.TimeSinceLastSentPacket() > s.params.Config.PausedMinWait {
s.params.Logger.Infow("stream allocator: resetting bwe to enable probing")
s.maybeStopProbe()
s.params.BWE.Reset()
// as BWE is reset, there is no finalizing for active cluster, so reset active cluster id
s.activeProbeClusterId = ccutils.ProbeClusterIdInvalid
}
if s.activeProbeClusterId != ccutils.ProbeClusterIdInvalid {
@@ -872,6 +875,8 @@ func (s *StreamAllocator) setState(state streamAllocatorState) {
s.maybeStopProbe()
s.params.BWE.Reset()
s.activeProbeClusterId = ccutils.ProbeClusterIdInvalid
}
}