resume: a route switch after a header-only payload stall never recovers, and hands a held group out past its max age

Open
#10,338 2 comments 1 reaction 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
rust

Research direction

Start with rs/moq-net/tests/integration/route_health.rs, especially the payload_stall reproduction and a_standby_recovers_a_payload_stall_within_its_budget from linked PR #10314. Compare the Stall::Headers behavior with the Upstream and Downstream cases, then trace how resume chooses the switch boundary and handles held groups. Done when the reader recovers after a clean switch and held groups past the 2 s max age are cut as Old.

Written by the indexing model from the issue text.

Description

quest

Problem

When the serving copy holds group headers whose frames never arrive (a header-only payload stall), resume mishandles the next route switch:

  1. A clean switch never recovers the reader. After a header-only stall on M1 -> E, closing that session cleanly leaves E reading nothing for the rest of the run. One group fails as Old, and the subscription neither ends nor resumes on the healthy route M2. The same close after an Upstream or Downstream stall (no headers held) recovers.
  2. A held group is delivered far past its max age. With a route-health standby moving the track to M2 (https://github.com/moq-dev/moq/pull/10314), group 3, whose header the replaced copy held, is handed out about 8 s after its successors, past the reader's 2 s max age, and is never cut as Old.

Reproduction

The first reproduces on main (cbd27de054) with rs/moq-net/tests/integration/route_health.rs's payload_stall diamond (one-second groups, 2 s max age). In payload_stall, replace the stalled write(span.as_secs()).await with:

if matches!(stall, Stall::Headers) && span.as_secs() == 10 {
	write(2).await;
	m1_e.server.abort(Error::Stream(StreamError::Cancel));
	m1_e.client.abort(Error::Stream(StreamError::Cancel));
	write(span.as_secs() - 2).await;
} else {
	write(span.as_secs()).await;
}

Then run payload_stall(Stall::Headers, Duration::from_secs(10)). E observes 0 frames and one Old failure. Stall::Upstream and Stall::Downstream with the same close observe 80 frames.

The second shows in #10314's a_standby_recovers_a_payload_stall_within_its_budget under Stall::Headers: group 3's frames arrive at the end of the run (stamped about 10.5 s after the stall began), while groups 4 to 11 arrive on time.

Suspect

Both involve a replaced copy that holds a group's header and none of its frames. The switch boundary is "the largest group any copy holds", so such a copy raises it, and its header-only groups are left to a copy that will never deliver them. They are then neither recovered from the serving route in time nor cut at the reader's budget.

(Written by Claude Opus 5.5)

Dominant language
Rust
Stars
1.6k
Forks
251
Avg merge
10h 10m
Merged PRs (30d)
822

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from moq-dev/moq

All issues in moq-dev/moq

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.