moq-net: keep a publisher's skips past the cache forgetting their records

Aperta
#10,300 1 commento 1 reazione 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
rust

Direzione di ricerca

Start with TrackState::drops, then follow pay_debt through shed_drops and forget_drops to see when skip records are discarded. Reproduce the timing-dependent behavior with the Rust harness case a_time_start_in_an_evicted_group using a pool of 3 * 64 bytes, and check the second range repro in the issue. The change is done when skipped keys remain uncreatable and readers get consistent skipped answers after records expire or are shed, including out-of-order creates through Requests.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Goal

A track's own publisher should answer a key it skipped the same way, however long ago it skipped it and however full its cache is. This applies in Rust (moq-net) and JS (@moq/net), and the state must stay bounded:

  • A new Requests handle can never create a skipped key.
  • A reader asking later never reads a skipped key as not found.

Context

Split from moq-net-publisher-accounting in https://github.com/moq-dev/moq/pull/10178.

Skip runs live in TrackState::drops. They are billed to the pool and forgotten either when the pool sheds them (pay_debt -> shed_drops -> forget_drops) or when their expiry window passes. That causes two symptoms:

  • Re-creation. When the last handle is released it records a skip. Once that skip ages out, a new Requests handle can create the skipped key.
  • Answers that depend on timing. Under pool pressure the publisher forgets the skips between its appends. A reader that asks later then reads them as not found, where an earlier reader read them as skipped. Readers' own records charge the same pool, so the number of readers decides how soon this happens.
    • Repro: run the Rust harness case a_time_start_in_an_evicted_group with a pool of 3 * 64 bytes instead of two(). A direct read gets gap 2500..3001 not found, group 4000 while it still holds the skip 3001..4000. A warmed relay asks after the skip is shed and reads gap 2500..4000 not found.
    • Second repro: a range from time 5 through 8, over appends at 0, 1, 2, 10, 11 in the two() pool. A direct read reports gap 5..9 not found once the pool sheds the skip 3..10, while relays read end.

Plan

Keep a write boundary that outlives the skip record. Below it, refuse a create, and answer an unrecorded key as skipped. Check this against out-of-order creates through Requests: those keep the keys below a created group owed while a handle lives.

Related: quest/m3/exact-fill-drops.md also bounds a publisher's verdict records without letting the cache decide them.

(Written by Claude Opus 5.5)

Lingua principale
Rust
Stelle
1.6k
Fork
251
Merge medio
10h 10m
PR unite (30g)
832

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di moq-dev/moq

Tutte le issue di moq-dev/moq

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.