Do not log warns on duplicate. (#2807)

With RTX, some clients use very old packets for probing. Check for
duplicate before logging warning about old packet/negative sequence
number jump.

Also, double the history so that duplicate tracking is better. Adds
about 1/2 KB per RTP stream.
This commit is contained in:
Raja Subramanian
2024-06-20 10:52:12 +05:30
committed by GitHub
parent 8a229fda9d
commit d4e50b633f
2 changed files with 26 additions and 24 deletions
+11 -11
View File
@@ -28,7 +28,7 @@ import (
)
const (
cHistorySize = 4096
cHistorySize = 8192
// RTCP Sender Reports are re-based to SFU time base so that all subscriber side
// can have the same time base (i. e. SFU time base). To convert publisher side
@@ -219,16 +219,6 @@ func (r *RTPStatsReceiver) Update(
}
}
if gapSN <= 0 { // duplicate OR out-of-order
if -gapSN >= cSequenceNumberLargeJumpThreshold {
if r.largeJumpNegativeCount%100 == 0 {
r.logger.Warnw(
"large sequence number gap negative", nil,
append(getLoggingFields(), "count", r.largeJumpNegativeCount)...,
)
}
r.largeJumpNegativeCount++
}
if gapSN != 0 {
r.packetsOutOfOrder++
}
@@ -248,6 +238,16 @@ func (r *RTPStatsReceiver) Update(
flowState.IsOutOfOrder = true
flowState.ExtSequenceNumber = resSN.ExtendedVal
flowState.ExtTimestamp = resTS.ExtendedVal
if !flowState.IsDuplicate && -gapSN >= cSequenceNumberLargeJumpThreshold {
if r.largeJumpNegativeCount%100 == 0 {
r.logger.Warnw(
"large sequence number gap negative", nil,
append(getLoggingFields(), "count", r.largeJumpNegativeCount)...,
)
}
r.largeJumpNegativeCount++
}
} else { // in-order
if gapSN >= cSequenceNumberLargeJumpThreshold || resTS.ExtendedVal < resTS.PreExtendedHighest {
if r.largeJumpCount%100 == 0 {