Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion quest/m1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ moves what remains of them once their claims merge.
- [Vendor and trim the WebRTC stack](/quest/m1/webrtc-vendor.md) - str0m, dimpl, `is`, and sctp-proto live in moq-webrtc with unused code removed, so moq-rtc can take rind
- [MoQ on rind](/quest/m1/rind/README.md) - every MoQ crate takes its crypto from rind, a pure-Rust graviola fork, so no build compiles C crypto
- [VAAPI encode and decode](/quest/m1/video-vaapi.md) - H.265 encode and decode, pre-generated bindings, and pooled resize surfaces, including the moq-dev/vaapi release that carries them
- [The over-limit PUBLISH refusal invites a retry](/quest/m1/retry-interval-overload.md) - `EXCESSIVE_LOAD` sends the may-pass retry interval, not 0
- [A relay forwards an upstream refusal's retry interval](/quest/m1/retry-interval-forward.md) - a forwarded SUBSCRIBE refusal keeps the upstream's retry interval
- [Tests run on a mocked clock](/quest/m1/mock-clock-tests/README.md) - about 300 tests stop proving nothing happened by waiting, sleeping to settle, or asserting on elapsed time

Expand Down
26 changes: 0 additions & 26 deletions quest/m1/retry-interval-overload.md

This file was deleted.

5 changes: 3 additions & 2 deletions rs/moq-net/src/ietf/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,9 +253,10 @@ pub(crate) mod request {
/// A refusal asking again may pass invites the backoff a refused token starts from. 0 asks the
/// peer never to retry a verdict, which would repeat. The code must leave the request open
/// too: a failed session can carry a verdict (UNAUTHORIZED, NOT_SUPPORTED), and UNINTERESTED
/// tells an offer to stop.
/// tells an offer to stop. EXCESSIVE_LOAD may pass whatever the error, once the load drops.
pub(crate) fn retry_interval(err: &Error, code: u64) -> u64 {
match err.retryable() && matches!(code, INTERNAL_ERROR | DOES_NOT_EXIST | GOING_AWAY) {
match code == EXCESSIVE_LOAD || err.retryable() && matches!(code, INTERNAL_ERROR | DOES_NOT_EXIST | GOING_AWAY)
{
true => crate::auth::RETRY_INITIAL.as_millis() as u64,
false => 0,
}
Expand Down
26 changes: 25 additions & 1 deletion rs/moq-net/src/ietf/subscriber/tracks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,11 @@ impl Subscriber {
let error = ietf::RequestError {
error_code: code,
reason_phrase: reason.into(),
retry_interval: 0,
// The rule judges the refusal as the peer reads it.
retry_interval: request::retry_interval(
&request::from_code(code, request::Kind::Publish, self.version),

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.

The invited retry does not reach a listener: this same arm still calls listings.fail(&key.0, err) (tracks.rs:490), which cancels the covering listing, so a retried PUBLISH for the namespace falls into the "listing cancelled" arm at tracks.rs:464 and is answered UNINTERESTED with interval 0. I measured it with a one-slot announces cap: the first offer gets EXCESSIVE_LOAD/1000 and the retry UNINTERESTED/0. Since the refused track is never inserted into entries, dropping that fail would let the retry land once a slot frees, and would stop one transient load refusal from dropping every other track under the namespace and aborting its readers.

Technical details
# The over-limit refusal cancels the listing it just asked the peer to retry on

## Affected sites
- `rs/moq-net/src/ietf/subscriber/tracks.rs:490` — `listings.fail(&key.0, err)` runs on the over-limit arm (`Error::TooManyRequests` from `announces.acquire()`).
- `rs/moq-net/src/ietf/subscriber/tracks.rs:464` — `Offer::Refuse(UNINTERESTED, "listing cancelled")` answers any offer under a request whose `live` is `None`, which `fail` just set.
- `rs/moq-net/src/ietf/subscriber/tracks.rs:528` — the interval the peer is now told to come back after.

## Observed
With `subscriber.announces = Slots::new(1)`, a listing on `bcast`, one accepted track: the second `PUBLISH` is refused `0x9`/1000; retrying that same `PUBLISH` is refused `0x20`/0 because `Listings::fail` cancelled the request and `covering` now returns `None`.

## Required outcome
A retried over-limit `PUBLISH` should reach the listing that is still standing, so it is either accepted once a slot frees or refused `EXCESSIVE_LOAD` again with the interval. Not failing the listing also stops the over-limit arm from dropping the other tracks the listing holds (via `release()`) and aborting its readers.

## Suggested approach
Drop the `listings.fail` call from the over-limit arm (`Err(_) => ...`) and keep only the `Offer::Refuse`. The property and listing-cancelled arms keep `fail` because the peer sends nothing more for those.

code,
),
};
request_stream::Reject::new(stream, error)
}
Expand Down Expand Up @@ -2122,6 +2126,26 @@ mod tests {
}
}

/// A PUBLISH over the listed-track limit is refused as EXCESSIVE_LOAD, which may pass once
/// the peer unlists a track, so it invites a retry (draft-18 section 10.6.2).
#[kio::test]
async fn an_over_limit_publish_invites_a_retry() {
for version in [Version::Draft18, Version::Draft20, Version::Draft22] {
let mut h = harness(version);
h.subscriber.announces = crate::session::Slots::new(0);
let _listing = h.establish().await;
let (_, id, body) = h.offer(offered("bcast", "video", 1)).await;
assert_eq!(id, ietf::RequestError::ID, "{version}: accepted");
let refused: ietf::RequestError = body.message(version).unwrap();
assert_eq!(refused.error_code, request::EXCESSIVE_LOAD, "{version}");
assert_eq!(
refused.retry_interval,
crate::auth::RETRY_INITIAL.as_millis() as u64,
"{version}"
);
}
}

/// A PUBLISH_DONE with TRACK_ENDED unlists the track as finished, and the listing stands.
#[kio::test]
async fn a_track_ended_publish_finishes_the_track() {
Expand Down
Loading