Remove WithPreJitterBufferReceiveTimeEnabled and always enable it#843
Conversation
📝 WalkthroughWalkthroughThe pull request removes the Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🧰 Additional context used🧬 Code graph analysis (1)pkg/synchronizer/track.go (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
✏️ Tip: You can disable this entire section by setting Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
pkg/synchronizer/track.go (1)
254-291:⚠️ Potential issue | 🟡 MinorGuard against zero ReceivedAt to avoid false "too old" drops and inconsistent logging.
The
getPTSWithoutRebase()andgetPTSWithRebase()methods usepkt.ReceivedAtdirectly without a zero-time guard, creating a risk and inconsistency. Theinitialize()method already includes the guard (if receivedAt.IsZero() { receivedAt = time.Now() }, lines 186-189), but these methods omit it. IfReceivedAtis ever zero,isPacketTooOld()will calltime.Since(time.Time{}), which yields a massive duration, causing false packet drops and skewed age/delay logging.Additionally,
pktReceiveTimeis assigned but then the code inconsistently uses bothpkt.ReceivedAt(lines 261–262, 280, 286–288, 368–369, 398, 404–406) andpktReceiveTime(lines 294, 412), defeating the purpose of the intermediate variable.✅ Suggested fix (safe fallback + consistent use)
now := time.Now() pktReceiveTime := pkt.ReceivedAt + if pktReceiveTime.IsZero() { + pktReceiveTime = now + } if t.firstTime.IsZero() { t.firstTime = now t.logger.Infow( "starting track synchronizer", "state", t, - "pktReceiveTime", pkt.ReceivedAt, - "startDelay", t.firstTime.Sub(pkt.ReceivedAt), + "pktReceiveTime", pktReceiveTime, + "startDelay", t.firstTime.Sub(pktReceiveTime), ) } else { t.updateGapHistogram(pkt.SequenceNumber - t.lastSN) } t.lastSN = pkt.SequenceNumber ts := pkt.Timestamp // if first packet of a frame was accepted, // accept all packets of the frame even if they are old if ts == t.lastTS { t.stats.numEmitted++ return t.lastPTSAdjusted, nil } // if first packet a frame was too old and dropped, // drop all packets of the frame irrespective of whether they are old or not - if ts == t.lastTSOldDropped || t.isPacketTooOld(pkt.ReceivedAt) { + if ts == t.lastTSOldDropped || t.isPacketTooOld(pktReceiveTime) { t.lastTSOldDropped = ts t.stats.numDroppedOld++ t.logger.Infow( "dropping old packet", "currentTS", ts, - "receivedAt", pkt.ReceivedAt, + "receivedAt", pktReceiveTime, "now", time.Now(), - "age", time.Since(pkt.ReceivedAt), + "age", time.Since(pktReceiveTime), "state", t, ) return 0, ErrPacketTooOld }Apply the same pattern to
getPTSWithRebase()(starting line 357).
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
pkg/synchronizer/synchronizer.gopkg/synchronizer/track.go
🧰 Additional context used
🧬 Code graph analysis (1)
pkg/synchronizer/track.go (1)
pkg/synchronizer/errors.go (1)
ErrPacketTooOld(23-23)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: test
✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.
Summary by CodeRabbit