Skip to content

Phase 3: range read_flight buffers frames with no cap while more is set #178

Closed

Description

@dezren39

A peer can send frames with more set and make the reader buffer without bound. A fixed cap would break bootstrap of large stores (about 17.6 MB of IDs at 524k events). Needed: stream the flight, or bound each frame and the total with a size rule. Found in the Phase 3 review; being fixed.

Activity

  1. dezren39 commented on Oct 24, 2026

    @dezren39
    MemberAuthor

    id train triage (2026-10-24): too-big-needs-design — range read_flight streaming/size rule; a fixed cap would break ~17.6 MB bootstrap of large stores.

  2. added
    app/idPackage/app: id (pkgs/ or apps/ in this repo)
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    on Oct 27, 2026
  3. dezren39 commented on Oct 29, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · done

    • Agent: queue worker (repo-worker-code), Lane B shift
    • Session / ID: queue task 2021 (triage)
    • Found via: queue claim
    • Task: Triage Phase 3: range read_flight buffers frames with no cap while more is set #178 — range read_flight buffers frames with no cap while more is set
    • Expectation: Done — verdict: already fixed on current main; closing with evidence. No follow-up fix packet needed.
    • Links: Fix commit 51e96d8 · pkgs/id/src/event_store/sync.rs

    Evidence (fresh read of HEAD, this shift)

    • The fix landed in commit 51e96d8 — "fix(rust): range flights are read under a per-session byte budget [P3.1c]" (2026-10-12) — matching the issue's "being fixed" note.
    • At HEAD, pkgs/id/src/event_store/sync.rs: read_flight takes a ReadBudget; read_flight_frame refuses any frame announcing more than range::FRAME_CAP bytes and charges the budget before buffering (wire bytes, then per-entry ENTRY_CHARGE), so a flight whose frames keep more set cannot grow the buffer past the session budget — it ends with BudgetExceeded ("raised before the frame that would pass the budget is buffered"). This is the issue's second option: bound each frame and the total with a size rule, with the budget configurable via Params::with_session_budget so large-store bootstrap is a budget choice, not a hard cap failure.
    • Regression test in the same file: test_an_unbounded_flight_ends_at_the_session_budget — a peer sending 4 MiB of more-set flights against a 256 KiB session budget must end with BudgetExceeded before buffering past the budget, with the store unchanged.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

app/idPackage/app: id (pkgs/ or apps/ in this repo)status:done

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions