Skip to content

A WHEP re-offer plays under load - #9241

Merged
kixelated merged 2 commits into
mainfrom
quest/m0/test-flakes-3/webrtc-reoffer-load
Nov 21, 2026
Merged

kixelated merged 2 commits into
mainfrom
quest/m0/test-flakes-3/webrtc-reoffer-load

Conversation

@kixelated

@kixelated kixelated commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

Claims quest/m0/test-flakes-3/webrtc-reoffer-load.md, and finishes it.

Summary

a_reoffer_from_the_same_address_plays pushed one Opus packet before its first viewer existed and then waited for it. Bridge::push cuts a group per packet, so that packet's group has a successor at once and goes stale egress::MAX_DELAY (100 ms) later. On a loaded host the session's ICE and DTLS take longer than that (a 330 ms gap between the mux listening and ICE checking was logged), so the session read nothing and the 10 s received timed out. That is the first received, not the re-offered session's push loop: the fixed test's second phase was already live. The test's own second-phase comment named the cause but only applied it there.

The fix is in the test: both phases now push from a live source until their viewer plays (played_live). The code under test is unchanged; no timeout was raised and nothing retries.

Validation

  • Reproduced before the fix: sixteen copies of the test binary at once inside systemd-run --user --scope -p CPUQuota=100%: 78 of 80 failed at 10 s with the panic at lib.rs:300. The viewer's ICE and DTLS completed in the failing runs; only media never arrived.
  • After: the same load, 80 of 80 pass (max 2.2 s); 48 copies at once, 144 of 144 pass (max 5 s).
  • KIO_DENY_HOST_TIMERS=1 cargo nextest run -p moq-webrtc: 109 passed. just check lint and format pass; its rs test step failed only on moq-cli tests that waited 60 s for machine-wide scheduler capacity on a busy host, none touching WebRTC.
  • A one-core quota alone, with 24 busy-loop processes and a single copy, did not reproduce: sixty runs all passed. Concurrent copies are the load that does.

Caused by

  • moq-dev/moq#9049 - added the test with a one-shot first packet that goes stale before a slow session connects (found by check).

Public API and wire

None.

Follow-ups

  • quest/m0/test-flakes-3/webrtc-live-source.md: five sibling moq-webrtc tests wait on the same one-shot packet and all time out under the same load (not seen flaking in just check yet). Left to a quest because each has its own take-over or kill step, and they should share one helper.
  • quest/m3/webrtc/reoffer-dtls-flight.md: a product finding. A re-offer's first DTLS flight reaches the mux 40 µs before the new session's ICE confirms the address, so the old session drops it and the handshake waits out a ~0.9 s retransmit. Measured with a debug print; needs a routing change in server/mux.rs that deserves its own review.

Models

Size: S
Implementer: Claude, claude-sonnet-5-5, default effort (arm B)

(Written by Sonnet 5.5)

Review

Rewritten by quest review after each round.

  • Head: 07ff0af

  • Base: origin/main at 2170d06

  • Risk: low, Only test code and quest plans change, so any regression affects contributor test coverage rather than consumers or deployed peers, and a revert fully undoes it.

  • Classified: low by Codex, gpt-6.1-sol, low effort, session 01a1fa88-643c-7672-98bf-67bf5b29c8a8

  • Reviewer: Codex, gpt-6.1-sol, medium effort

  • Session: 01a1fa88-7727-7753-ad4f-e3ea13666126, round 1

  • Score: 9/10, Source inspection found no actionable defects: the test keeps its source live during both connections and preserves the re-offer playback check, though execution checks were intentionally omitted.

  • Rounds: 1; first round 0; findings 0: fixed 0, refuted 0, open 0

  • Findings: none

kixelated and others added 2 commits November 20, 2026 10:25
… plays

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@kixelated
kixelated marked this pull request as ready for review November 20, 2026 19:57
@coderabbitai

coderabbitai Bot commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 9 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 01c4f8bb-811d-46a6-9c49-2200cc4a76b1
Commits

Reviewing files that changed from the base of the PR and between 9828a20 and 07ff0af.

Files selected for processing: 4

  • quest/m0/test-flakes-3/webrtc-live-source.md
  • quest/m0/test-flakes-3/webrtc-reoffer-load.md
  • quest/m3/webrtc/reoffer-dtls-flight.md
  • rs/moq-webrtc/src/lib.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Approach: sound. The test now pushes from a live source in both phases, which fixes the stale-first-packet cause rather than raising a timeout.

Reviewed changes

Reviewed the full diff: one test change and three quest plan files.

  • played_live helper (rs/moq-webrtc/src/lib.rs): pushes a packet every 20 ms until the viewer receives one, and replaces the one-shot first packet and the inline loop in the second phase.
  • a_reoffer_from_the_same_address_plays: both phases now use played_live and assert NEW_PACKET. Nothing pushes OPUS_PACKET any more, so the tightened assertion is correct.
  • Quest files: the claim, the sibling-tests follow-up and the DTLS flight finding. None change code.

Pullfrog  | View workflow run | Using claude-sonnet-5-5 | 𝕏

@kixelated
kixelated added this pull request to the merge queue Nov 21, 2026
Merged via the queue into main with commit 5169af0 Nov 21, 2026
10 checks passed
@kixelated
kixelated deleted the quest/m0/test-flakes-3/webrtc-reoffer-load branch November 21, 2026 00:46
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