Skip to content

Fix/viewer replay egress tuning - #16

Merged
datagutt merged 2 commits into
mainfrom
fix/viewer-replay-egress-tuning
Jul 14, 2026
Merged

datagutt merged 2 commits into
mainfrom
fix/viewer-replay-egress-tuning

Conversation

@datagutt

Copy link
Copy Markdown
Member

No description provided.

datagutt added 2 commits July 6, 2026 22:05
…ostics

A viewer that fell behind could bank multiple seconds of publisher-ring
backlog and then burst it out (MAX_EGRESS_BATCHES=8, ~20x realtime), which a
viewer perceives as a jump back then skip forward. Treat the ring as a
hand-off buffer, not a jitter buffer: size it at 1x the latency window (was
2x) and drain at most 2 batches per egress pass (was 8), so a viewer that
falls behind is skipped forward per packet by SRT TLPKTDROP at the socket
instead of catching up on a burst of stale frames. The SRT socket holds each
viewer's latency window.

Also add per-stream observability for this class of issue:
- /stats maxReaderBacklogBytes / maxReaderBacklogMs (furthest any viewer fell
  behind the ring write head).
- fix sendBackpressure, which was read off the publisher role (which never
  runs the egress write path) and so was structurally always 0; now
  aggregated across a stream's viewers via the shared ring.
- stream=<name> on teardown log lines for grep, plus a publisher session-end
  flight-recorder line that survives publisher reconnect.
@datagutt
datagutt merged commit d45b948 into main Jul 14, 2026
13 of 17 checks passed
@coderabbitai

coderabbitai Bot commented Jul 14, 2026 •

Copy link
Copy Markdown

Caution

Review failed

An error occurred during the review process. Please try again later.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/viewer-replay-egress-tuning

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@datagutt
datagutt deleted the fix/viewer-replay-egress-tuning branch July 17, 2026 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant