{"record":{"id":"e15124736c71661a","repo":"livekit/livekit","slug":"packet-is-older-than-packet-group-start","errorCode":null,"errorMessage":"packet is older than packet group start","messagePattern":"packet is older than packet group start","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"info","filePath":"pkg/sfu/bwe/sendsidebwe/packet_group.go","lineNumber":30,"sourceCode":"// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage sendsidebwe\n\nimport (\n\t\"errors\"\n\t\"time\"\n\n\t\"github.com/livekit/protocol/logger\"\n\t\"github.com/livekit/protocol/utils\"\n\t\"go.uber.org/zap/zapcore\"\n)\n\n// -------------------------------------------------------------\n\nvar (\n\terrGroupFinalized = errors.New(\"packet group is finalized\")\n\terrOldPacket      = errors.New(\"packet is older than packet group start\")\n)\n\n// -------------------------------------------------------------\n\ntype PacketGroupConfig struct {\n\tMinPackets        int           `yaml:\"min_packets,omitempty\"`\n\tMaxWindowDuration time.Duration `yaml:\"max_window_duration,omitempty\"`\n}\n\nvar (\n\tdefaultPacketGroupConfig = PacketGroupConfig{\n\t\tMinPackets:        30,\n\t\tMaxWindowDuration: 500 * time.Millisecond,\n\t}\n)\n\n// -------------------------------------------------------------\n","sourceCodeStart":12,"sourceCodeEnd":48,"githubUrl":"https://github.com/livekit/livekit/blob/ee45c3f0b1a83bf4352dbccb6607ebf70b2a5de6/pkg/sfu/bwe/sendsidebwe/packet_group.go#L12-L48","documentation":"A PacketGroup tracks packets starting from a minimum sequence number; a packet with a sequence number below that start is stale relative to the group and rejected with errOldPacket rather than being counted in bandwidth calculations.","triggerScenarios":"onPacketReceived delivering a transport-cc packet whose sequence number precedes the current group's minSequenceNumber — typically after group rollover or when processing buffered/delayed feedback.","commonSituations":"Reordered packet arrival across group boundaries; delayed send/recv delta reports being fed after a new group started; burst catch-up after a processing stall.","solutions":["None needed — stale packets are intentionally excluded from the estimate.","If frequent, investigate packet reordering or feedback delay in the network path.","Upgrade LiveKit for group-rollover refinements in send-side BWE.","Monitor alongside 'packet group is finalized' logs to spot boundary churn."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := opg.Add(pi, sendDelta, recvDelta, isLost); err != nil {\n  if errors.Is(err, errOldPacket) { return /* stale, skip */ }\n  if errors.Is(err, errGroupFinalized) { /* start new group */ }\n}","preventionTips":["Ignore errOldPacket — stale packets must not affect estimates.","Sequence packet feedback monotonically before feeding the detector.","Avoid replaying buffered deltas after group rollover.","Correlate with errGroupFinalized logs to detect boundary churn."],"tags":["bandwidth-estimation","webrtc","gcc","transport-cc"],"backgroundTag":"packet-older-than-group","analyzedSha":"ee45c3f0b1a83bf4352dbccb6607ebf70b2a5de6","analyzedAt":"2026-09-02T03:56:08.477Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}