Repository navigation
fix(net): a SUBSCRIBE_UPDATE restating what is live is not sent - #9510
Conversation
Quest-Claim: 6f470558fdc6dfbb
A copy's demand change buffered an update even when it changed nothing on the wire. Since a live join's aggregate carries the process-wide join tick, any other track's answer between two joins made each join send one, so joins stopped coalescing into one refresh request whenever the process was busy: `refresh_joins_coalesce_upstream` failed beside its module, and a relay sent an empty edit per join. Rust and JS now skip an update whose terms match the last sent and whose edit (lite-07) or span (older) is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
✅ No new issues found.
Approach: sound. It fixes the cause: a demand change no longer turns into an update that restates the live ranges and terms. It doesn't touch the trigger (the process-wide join tick), and it applies the same rule in Rust and JS.
Reviewed changes
I reviewed all five files: the Rust and JS skip guards, the test-only hook for moving the tick, and both regression tests.
- Rust skip guard:
begin_subscriptionrecords(priority, order, max_delay)andactive.live.unchanged()before the edit, and callsbuffer_updateonly when one of them changes. Leavingwanted_groupout is correct, because the refresh path sends its own update. - JS skip guard:
restates()compares each update againstlive.livestarts from the SUBSCRIBE that was sent (#withRangeschanges that samemsg) and moves to each update, sent or skipped, so it always matches what the publisher holds. A skip also leavesentry.sentalone, which is right:#finishTailonly needs to settle again when an update asks for more. - Publisher effect: I checked
TrackRun::update. A restated update only disarmsIdleand repeats a pendingAsk::Refresh, and both coalesce, so skipping it changes nothing the publisher serves. - Tests:
answer_elsewhere()is gated oncfg(all(test, feature = "async")), which matches the async gate on the litesubscribermodule. With it, both tests hit the case on every run.
claude-opus-5-5 | 𝕏
|
No actionable comments were generated in the recent review. WalkthroughThe JavaScript and Rust subscriber paths now suppress or avoid buffering subscription updates when their compared terms have not changed. The comparison includes range edits and subscription settings, with protocol-version-specific checks in the JavaScript path. Tests exercise joins across advancing ticks and check upstream write counts. The test-flake document about duplicate requests is removed. Merge Risk:
|
|
quest land watch: the merge queue removed this pull request at e0f009d because its The land fixer works on it in the background, and the watcher re-enqueues it at the back of the queue once it is fixed or judged flaky, or hands it back here with what it needs.
…oq-mux container::ts::passthrough_test::a_vbr_passthrough_clears_a_recorded_rate
PASS [ 0.033s] ( 4060/11368) moq-mux container::ts::passthrough_test::objects_after_the_last_pcr_extrapolate_its_rate
PASS [ 0.076s] ( 4061/11368) moq-mux container::ts::passthrough_test::a_step_that_is_not_elapsed_time_is_spliced
PASS [ 0.073s] ( 4062/11368) moq-mux container::ts::passthrough_test::an_import_shifts_onto_a_clock_already_in_use
PASS [ 0.042s] ( 4063/11368) moq-mux container::ts::passthrough_test::random_access_lost_to_a_second_program_stays_lost
PASS [ 0.038s] ( 4064/11368) moq-mux container::ts::passthrough_test::two_programs_on_one_clock_publish_no_random_access
PASS [ 0.047s] ( 4065/11368) moq-mux container::ts::passthrough_test::the_clock_is_found_behind_a_pmt_split_across_packets
PASS [ 0.032s] ( 4066/11368) moq-mux container::ts::pes_packet_test::a_clock_break_places_each_side_on_its_own_timebase
PASS [ 0.051s] ( 4067/11368) moq-mux container::ts::passthrough_test::the_pcr_wrap_continues_the_timeline
PASS [ 0.019s] ( 4068/11368) moq-mux container::ts::pes_packet_test::a_data_only_program_without_pcr_refuses_sections_and_whole_pes
PASS [ 0.053s] ( 4069/11368) moq-mux container::ts::passthrough_test::two_video_streams_in_one_program_publish_no_random_access
PASS [ 0.046s] ( 4070/11368) moq-mux container::ts::pes_packet_test::a_data_only_program_preserves_placements_across_the_pcr_wrap
PASS [ 0.065s] ( 4071/11368) moq-mux container::ts::passthrough_test::the_section_goes_with_the_importer
PASS [ 0.182s] ( 4072/11368) moq-mux container::ts::passthrough_test::a_clock_that_stops_is_refused_once_a_group_would_overflow
PASS [ 0.030s] ( 4073/11368) moq-mux container::ts::pes_packet_test::a_pes_header_held_past_several_pcrs_takes_the_first_after_it
PASS [ 0.029s] ( 4074/11368) moq-mux container::ts::pes_packet_test::a_pes_header_split_by_a_pcr_is_placed_from_its_start_code
PASS [ 0.033s] ( 4075/11368) moq-mux container::ts::pes_packet_test::a_pcr_pid_switch_places_each_side_on_its_own_timebase
PASS [ 0.047s] ( 4076/11368) moq-mux container::ts::pes_packet_test::a_dropped_private_stream_finishes_and_its_reused_pid_opens_a_new_track
PASS [ 0.205s] ( 4077/11368) moq-mux container::ts::passthrough_test::a_clock_in_every_packet_splits_at_the_object_ceiling
PASS [ 0.043s] ( 4078/11368) moq-mux container::ts::pes_packet_test::a_pes_past_a_lone_pcr_is_unplaced
PASS [ 0.030s] ( 4079/11368) moq-mux container::ts::pes_packet_test::a_private_stream_dropped_before_the_media_clock_refuses_the_import
PASS [ 0.028s] ( 4080/11368) moq-mux container::ts::pes_packet_test::a_program_with_missing_media_timestamps_is_refused
PASS [ 0.037s] ( 4081/11368) moq-mux container::ts::pes_packet_test::a_private_stream_dropped_past_a_lone_pcr_counts_its_pes_unplaced
PASS [ 0.031s] ( 4082/11368) moq-mux container::ts::pes_packet_test::a_revised_private_stream_publishes_under_a_fresh_name
PASS [ 0.057s] ( 4083/11368) moq-mux container::ts::pes_packet_test::a_pes_with_a_field_no_rebase_reaches_refuses_its_stream
FAIL [ 10.209s] ( 4084/11368) moq-ffi test::server_client_run_end_draft20
stdout ───
running 1 test
test test::server_client_run_end_draft20 ... FAILED
failures:
failures:
test::server_client_run_end_draft20
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 337 filtered out; finished in 10.17s
stderr ───
thread 'test::server_client_run_end_draft20' (2802480) panicked at rs/moq-ffi/src/test.rs:6450:10:
timed out waiting for frame: Elapsed
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Cancelling due to test failure: 23 tests still running
PASS [ 0.037s] ( 4085/11368) moq-mux container::ts::pes_packet_test::a_program_without_a_pcr_refuses_private_pes
PASS [ 0.027s] ( 4086/11368) moq-mux container::ts::pes_packet_test::dvb_ac3_keeps_its_sync_frames_in_one_pes
PASS [ 0.053s] ( 4087/11368) moq-mux container::ts::pes_packet_test::a_pmt_naming_or_dropping_the_pcr_reroutes_private_pes
PASS [ 0.047s] ( 4088/11368) moq-mux container::ts::pes_packet_test::a_scrambled_pes_is_refused_until_clear
PASS [ 0.148s] ( 4089/11368) moq-mux container::ts::passthrough_test::leading_junk_does_not_hide_the_grid
PASS [ 0.141s] ( 4090/11368) moq-mux container::ts::passthrough_test::objects_do_not_depend_on_how_the_input_is_chunked
PASS [ 0.022s] ( 4091/11368) moq-mux container::ts::programs::test::a_corrupt_pat_starts_no_program
PASS [ 0.037s] ( 4092/11368) moq-mux container::ts::pes_packet_test::optional_fields_and_bare_stream_ids_go_through_untouched
PASS [ 0.046s] ( 4093/11368) moq-mux container::ts::pes_packet_test::async_klv_takes_the_program_clock_at_its_first_byte
PASS [ 0.036s] ( 4094/11368) moq-mux container::ts::pes_packet_test::pmt_revisions_apply_across_the_version_wrap
PASS [ 0.375s] ( 4095/11368) moq-mux container::ts::import_test::import_reports_a_silent_audio_pid
PASS [ 0.035s] ( 4096/11368) moq-mux container::ts::programs::test::a_corrupt_pat_beside_a_good_one_counts_once
PASS [ 0.066s] ( 4097/11368) moq-mux container::ts::pes_packet_test::sync_klv_rebases_its_pts_and_dts_onto_the_catalog_clock
PASS [ 0.415s] ( 4098/11368) moq-mux container::ts::import_test::import_reports_a_silent_scte35_pid
PASS [ 2.150s] ( 4099/11368) moq-mux container::ts::export_timing_test::frames_held_through_a_silence_drop_as_late
PASS [ 0.098s] ( 4100/11368) moq-mux container::ts::pes_packet_test::tiny_whole_pes_held_for_a_timestamp_are_bounded_by_count
PASS [ 3.620s] ( 4101/11368) moq-mux container::ts::export_test::a_skipped_group_flags_the_clock
PASS [ 0.484s] ( 4102/11368) moq-mux container::ts::passthrough_test::a_long_gop_splits_at_the_byte_ceiling_between_objects
PASS [ 0.738s] ( 4103/11368) moq-mux container::ts::import::test::untimed_sections_stop_at_the_shared_budget_and_release_after_a_clock
PASS [ 5.349s] ( 4104/11368) moq-mux container::ts::export_timing_test::an_unmarked_step_keeps_the_export_rendering
PASS [ 6.716s] ( 4105/11368) moq-mux container::ts::export_timing_test::a_joiner_keeps_the_system_clock_in_tolerance
PASS [ 6.788s] ( 4106/11368) moq-mux container::ts::export_timing_test::two_legs_render_a_fast_drifting_source_the_same_way
PASS [ 6.804s] ( 4107/11368) moq-mux container::ts::export_timing_test::two_legs_render_a_slow_drifting_source_the_same_way
────────────
Summary [ 21.223s] 4107/11368 tests run: 4106 passed, 1 failed, 146 skipped
FAIL [ 10.209s] ( 4084/11368) moq-ffi test::server_client_run_end_draft20
stdout ───
running 1 test
test test::server_client_run_end_draft20 ... FAILED
failures:
failures:
test::server_client_run_end_draft20
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 337 filtered out; finished in 10.17s
stderr ───
thread 'test::server_client_run_end_draft20' (2802480) panicked at rs/moq-ffi/src/test.rs:6450:10:
timed out waiting for frame: Elapsed
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: 7261/11368 tests were not run due to test failure (run with --no-fail-fast to run all tests, or run with --max-fail)
error: test run failed
mbx[cache]: object cache: 0 hits, 99 misses, 73 bypassed; 0 B downloaded, 0 B uploaded, 4.1 GiB stored locally
mbx[cache]: 3m 2s session; 0s estimated compiler time avoided (summed across compilations)
mbx[cache]: bypass reasons: 73 unsupported-crate-type
mbx[cache]: Cargo artifact reuse and CI cache archive transfers are not included above
mbx[savings]: 1.1 TiB of outputs exist once and appear everywhere. do not tell the checkouts.
error: recipe `test` failed on line 365 with exit code 100
error: recipe `test-changed` failed on line 118 with exit code 100
##[endgroup]
##[error]ci: test rs failed
error: recipe `ci` failed on line 121 with exit code 100
##[error]Process completed with exit code 100.
##[group]Run actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9
with:
name: cargo-timings
path: target/cargo-timings/cargo-timing-*.html
if-no-files-found: ignore
retention-days: 14
compression-level: 6
overwrite: false
include-hidden-files: false
archive: true
env:
BASE: e56d723e6069033493b2a0656e087669de000400
CHECK_FAIL_FAST: 1
NEXTEST_TEST_THREADS: 24
MBX_CACHE_LINKS: 1
MBX_REMOTE_URL:
##[endgroup]
With the provided path, there will be 7 files uploaded
Artifact name is valid!
Root directory input is valid!
Uploading artifact: cargo-timings.zip
Beginning upload of artifact content to blob storage
Uploaded bytes 399056
Finished uploading artifact content to blob storage!
SHA256 digest of uploaded artifact is eb4ed426eedd5825e584277b8582106108d15d5238257f94078191c09362102e
Finalizing artifact upload
Artifact cargo-timings successfully finalized. Artifact ID 14883357448
Artifact cargo-timings has been successfully uploaded! Final size is 399056 bytes. Artifact ID is 14883357448
Artifact download URL: https://github.com/moq-dev/moq/actions/runs/45310610425/artifacts/14883357448
Post job cleanup.
##[start-action display=Run jdx/mr-boxington-action@88acf2bb50552c7c508cbac13e5f8c576b95b1de;id=__acad60c9-d291-4fbb-94e1-948c23837d63.mbx]
##[end-action id=__acad60c9-d291-4fbb-94e1-948c23837d63.mbx;outcome=skipped;conclusion=skipped;duration_ms=0]
Post job cleanup.
[command]/nix/store/i2m3w4ly2w6grrmk1j59rb7zp09bssia-git-2.56.0/bin/git version
git version 2.56.0
Temporarily overriding HOME='/var/cache/github-runner-work/_temp/fa26ec69-ba8f-47a0-a631-991552a05b45' before making global git config changes
Adding repository directory to the temporary git global config as a safe directory
[command]/nix/store/i2m3w4ly2w6grrmk1j59rb7zp09bssia-git-2.56.0/bin/git config --global --add safe.directory /var/cache/github-runner-work/moq/moq
Removing SSH command configuration
[command]/nix/store/i2m3w4ly2w6grrmk1j59rb7zp09bssia-git-2.56.0/bin/git config --local --name-only --get-regexp core\.sshCommand
[command]/nix/store/i2m3w4ly2w6grrmk1j59rb7zp09bssia-git-2.56.0/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'core\.sshCommand' && git config --local --unset-all 'core.sshCommand' || :"
Removing HTTP extra header
[command]/nix/store/i2m3w4ly2w6grrmk1j59rb7zp09bssia-git-2.56.0/bin/git config --local --name-only --get-regexp http\.https\:\/\/github\.com\/\.extraheader
[command]/nix/store/i2m3w4ly2w6grrmk1j59rb7zp09bssia-git-2.56.0/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'http\.https\:\/\/github\.com\/\.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :"
Removing includeIf entries pointing to credentials config files
[command]/nix/store/i2m3w4ly2w6grrmk1j59rb7zp09bssia-git-2.56.0/bin/git config --local --name-only --get-regexp ^includeIf\.gitdir:
[command]/nix/store/i2m3w4ly2w6grrmk1j59rb7zp09bssia-git-2.56.0/bin/git submodule foreach --recursive git config --local --show-origin --name-only --get-regexp remote.origin.url
A job completed hook has been configured by the self-hosted runner administrator
##[group]Run '/nix/store/qrn6ds64bzvwbm5nwf245ifz2c6jb9xw-ci-cache-gc.sh/bin/ci-cache-gc.sh'
shell: /nix/store/lfm00fnq66xfgbn099vqckabyl5jllz6-bash-interactive-5.3p20/bin/bash --noprofile --norc -e -o pipefail {0}
##[endgroup]
evicted 899 objects and 15 action results (4.6 GiB logical); 50.0 GiB logical remain
dropped 13 session event streams
evicted 0 objects and 0 action results (0 B logical); 50.0 GiB logical remain
Cleaning up orphan processes
(written by quest land watch) |
|
codex, gpt-6.1-sol, medium effort land fixer note:
(written by codex, gpt-6.1-sol, medium effort) |
|
quest land watch: re-enqueued this pull request at e0f009d, at the back of the merge queue, unchanged, since the land fixer judged the failure flaky: (written by quest land watch) |
…s a hold `Pool::hold_room` passed with a single byte free, so a recovered group bigger than the room beside the pins and the holds was held as it landed, evicted once the holds no longer fit (which freed its hold), and asked again on every eviction. `Lost` now records each debt eviction's size, a fill's held answer as well as a live group, and a reader or a lite-07 recovery asks again only for a key whose size fits beside the pinned bytes and the holds; the rest is given up once. Also drops the duplicate refresh-joins-shared-process quest, which #9510 fixed at its cause. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The flake was the join tick moving between joins, so each join asked upstream again. #9510 stopped sending an update that restates what is live; reverting that guard alone fails the test deterministically. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…oq-dev#9542) Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>

Finishes quest/m0/test-flakes-3/refresh-joins-coalesce.md.
Problem
lite::subscriber::tests::refresh_joins_coalesce_upstreamfailed 3 of 4 runs ofcargo test -p moq-net --all-features --lib lite::subscriber, seeing[1, 1]where the eight joins should send one SUBSCRIBE_UPDATE. It passed under nextest, which runs one test per process.The cause is real behavior, not the test. A copy's demand change always buffered a SUBSCRIBE_UPDATE, even when the update restated exactly what was live. A live join's aggregate (
JoinAsk::since) carries the process-wide join tick (JOIN_TICK), which every live-join answer on any track bumps. So when another test, or in a relay another track, recorded an answer between two joins, the combined subscription "changed", and each join sent an update with an empty edit and the same terms. Joins stop coalescing whenever the process is busy. Bumping the tick by hand before each join makes the test send eight updates every run.JS had the same flaw:
sameJoinscomparessince, and its update loop wrote whatever it built. JS also sent one no-op update on the first wake even without a tick bump, becausesentJoinsstarts empty.Approach
TrackServe::begin_subscription): skipbuffer_updatewhen the edit equalsLiveRanges::unchanged()(an empty edit on lite-07, the same list before it) and priority, order, and max delay are unchanged. The rest of the bookkeeping (tail, declare, start) still runs.Subscriberupdate loop): the same rule asrestates(version, update, live), comparing against the terms the publisher last heard, initialized from the SUBSCRIBE.model::track::answer_elsewhere, test-only), so it covers this case on every run, whatever else shares the process. A JS mirror,a lite-07 copy coalesces joins its unanswered probe already asks, holds the probe unanswered and asserts nothing further is written.A restated update did nothing on the publisher. Its
updateonly disarms anIdleread cache and re-asks a wanted group that is already pending (that ask coalesces), so skipping it changes nothing the publisher serves.Impact
Alternatives
sincefrom what the update loop compares. Rejected: a join whose probe was answered before it began needs that comparison to re-ask (join_probes).Validation
main: the module run failed 3/4 withleft: [1, 1]. With oneanswered()before each join, the test fails deterministically with[1, 1, 1, 1, 1, 1, 1, 1].cargo test -p moq-net --all-features --lib lite::subscriberpassed 20/20, the full--all-features --libsuite 5/5, and the quest's--features async --librun passed. Reverting just the guard makes the new Rust test fail (eight updates), and the JS test fail (5 writes against 2).moq-net's integration suite. All 649 tests passed, and 172 of them had hit a restating update, 2136 in total (583 inmesh_sweep::seeded_meshes_hold_the_route_rules, 241 incatalog_churn::catalog_churn_lite_07), all now skipped.just checkpassed (Rust 11364/11364, JSbun test3808/3808).just test interop --allpassed (Rust ⇄ JS, every lite version).just checkruns hit nextest timeouts on unrelated tests (dial_split_horizon,moq-tokiofresh_port,moq-hlsgrid). Each one's stderr wasmbx: waiting for machine-wide scheduler capacity before starting this test: host load, before the test began. Each passes when re-run, anddialed_anonymous_session_does_not_echo_or_route_subscribe_backpassed a 400× stress run.just cion this head failed in two places, neither caused by this PR:widened_max_age.test.ts›a widening recovers the stale groups for a bounded lite-07 readergot[1n, 3n]for[3n, 4n]. It fails the same way inmain's nightly atb29b90be(run), and moq-dev/moq#9505'squest/m0/nightly/js-widened-max-age.mdowns it. On this branch it passed 30/30 alone, 160/160 at 16-way parallel, and 6/6 fulljs/netruns.moq-netintegration tests timed out whilembxwaited for scheduler capacity, before they started. All four pass when re-run, andjust checkran all 11364 Rust tests on this head without a failure.Caused by
JoinAsk::since). Another track's answer then reads as a demand change, and every demand change sent an update (found by check).Follow-ups
quest/m0/test-flakes-3/refresh-joins-shared-process.mdabout the same test failing beside its module. This PR fixes that cause, so that quest is a duplicate: asked there for it to be dropped. That PR also adds tests inrs/moq-net/src/lite/subscriber.rs, in other parts of the test module. This change touches onlybegin_subscriptionand this one test, so the two shouldn't conflict.Models
Size: S
Implementer: Claude, claude-opus-5-5, high effort
(Written by Claude Opus 5.5 with high)
🤖 Generated with Claude Code
Review
Rewritten by
quest reviewafter each round.Head: e0f009d
Base: origin/main at c262012
Risk: medium,
If the new "restates" check wrongly suppresses a SUBSCRIBE_UPDATE that changes live terms, a publisher keeps stale priority, range, or join state for lite subscribers (moq-net and @moq/net users), but the wire format and public API are unchanged and a revert fully undoes it, so this is a fix rather than a high-risk break.Classified: medium by Claude Code, claude-haiku-5-5, low effort, session
fb577e34-f5a5-43e4-ad0c-74df343b10feReviewer: Codex, gpt-6.1-sol, medium effort
Session:
01a20b39-2444-7f00-9e85-35d86b8a5927, round 1Score: 9/10,
Source review found no actionable defects and preserved subscription behavior, but builds and tests were not run as instructed.Rounds: 1; first round 0; findings 0: fixed 0, refuted 0, open 0
Findings: none