GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — id(waiting): WaitingPool's arrived set grows with every event ever applied — +37 MB per 2M arrivals in a pool that reports itself empty, and no production caller ever reads it · Issue #1730 · developing-today/code

id(waiting): WaitingPool's arrived set grows with every event ever applied — +37 MB per 2M arrivals in a pool that reports itself empty, and no production caller ever reads it #1730

New issue
Copy link
New issue
Copy link
Closed
#3752
Closed
id(waiting): WaitingPool's arrived set grows with every event ever applied — +37 MB per 2M arrivals in a pool that reports itself empty, and no production caller ever reads it#1730
#3752
Copy link
Assignees
dezren39
Labels
app/idPackage/app: id (pkgs/ or apps/ in this repo)effort/sSmall: expected under 2 hours of workkind/performancePerformance problem or optimizationpriority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobtask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

Description

@dezren39
dezren39
opened on Oct 28, 2026
Issue body actions

Problem

WaitingPool (pkgs/id/src/waiting.rs) remembers every key that has ever arrived, forever:

  • arrived: HashSet<K> (waiting.rs:135) — "Keys that have arrived, and stay arrived."
  • WaitingPool::arrived (waiting.rs:324-344) inserts the key into that set on every call and nothing ever removes from it: there is no eviction, no expiry (the age cap applies only to held events), and no reset short of dropping the pool.
  • The event store holds one pool for the life of the store (event_store/mod.rs:342, built at :382) and calls pool.arrived on every applied event and every fork-proof header, via waiting_rows.rs release (:262) and present_proof (:274). So a long-lived node's pool grows by one hash set entry per event it has ever applied — while the pool's actual held set is capped at 256 per author.

The growth buys nothing in production: the store's hold path uses pool.restore (waiting_rows.rs hold), which consults only by_key, never arrived. The set is read only by the pool's own insert/park duplicate-and-dependency filter (waiting.rs:202, :207, :234), which no production caller uses — the store is the only non-test constructor of a pool besides the property tests. In the running server the set is effectively write-only memory.

Evidence (verified this run, main 8c6bdc09)

  • Line trace of waiting.rs: arrived set is inserted at :343; searches for removal/clear of the set across the file and its callers find none.
  • Caller trace: grep for pool.insert / pool.park / .insert( on the pool across pkgs/id/src/event_store/ finds no production use; holds go through restore, releases through arrived.
  • Laptop probe executed this run (probe crate against the real id crate as a path dependency, ~/git/fleet/probe-2026-10-28-lanea-waiting/ on the laptop; waiting.rs sha256 9e693d746d… identical on sandbox main 8c6bdc09 and the laptop; log in hidden_files/probe-2026-10-28-laneA-waiting/probe.log): 2,000,000 arrived() calls with distinct keys and no waiters moved RSS 2,816 KB → 39,816 KB (+37 MB) while the pool reports len() == 0 and is_empty() == true; the same key arriving 2,000,000 times moved RSS by 4 KB. Behavioural check in the same probe: re-inserting an already-arrived key is silently swallowed (ready=0, held=0), confirming the set — not any held state — is what retains the keys.

Distinct from #1567 (no total cap on held waiting events — that is about events still waiting; this is about keys of events already applied, which no cap touches) and from #1726 (outbox retention — different store).

Why it matters

id serve is a long-lived process syncing every event of every world it hosts. An uncapped, never-read set that grows per applied event is a slow memory leak proportional to total history, not to live state — the opposite of the pool's own design, where held events are capped per author and aged out in 7 days.

Acceptance criteria

  • The fix direction is pinned in triage: e.g. drop the arrived set from the store's path (the store already knows applied keys from its tables), bound it, or make restore-based callers not populate it — while keeping the pool's standalone insert/park contract correct for direct users, or explicitly changing that contract with its docs.
  • After the fix, applying N events through the store leaves the pool's memory independent of N (held events aside); a regression test or property test demonstrates no per-applied-event growth (the existing tests/waiting_properties.rs harness is a natural home).
  • Duplicate/replay behaviour is unchanged: re-delivering an already-applied event is still recognised (by the store's applied table), and a waiting event whose dependency applies is still released.
  • Existing waiting pool unit tests and tests/waiting_properties.rs pass (laptop or CI).

Activity

Next
  1. developing-today commented on Oct 28, 2026

    @developing-today
    developing-todayBot
    on Oct 28, 2026 – with developing.today
    Contributor
    More actions

    CODE-696

  2. dezren39
    added
    kind/performancePerformance problem or optimization
    queue/queuedHas a queued queue task
    source/creatorFiled by the new-issue-creator job
    task/triageQueue packet kind: verify, reproduce, and route this item
    status/needs-triageNot yet triaged; needs a first look
    priority/normalOrdinary priority (the default)
    app/idPackage/app: id (pkgs/ or apps/ in this repo)
    effort/sSmall: expected under 2 hours of work
    on Oct 28, 2026
  3. dezren39 commented on Oct 28, 2026

    @dezren39
    dezren39
    on Oct 28, 2026
    MemberAuthor
    More actions

    Filed this run by new-issue-creator-code-a (lane A). Found via: line + caller trace of pkgs/id/src/waiting.rs and pkgs/id/src/event_store/ (store holds go through restore, which never reads the arrived set), plus an executed laptop probe against the real id crate (~/git/fleet/probe-2026-10-28-lanea-waiting/): 2M distinct arrived() keys = +37 MB RSS in an empty pool; same-key control = +4 KB. Verified on main 8c6bdc0 (waiting.rs sha256 9e693d746d, identical on laptop). Distinct from #1567 (held-event total cap). Enqueued as a repo-task/v1 triage packet in repo-health-code-pilot.

  4. github-actions
    assigned
    dezren39
    on Oct 28, 2026
  5. dezren39
    added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed
    status/needs-triageNot yet triaged; needs a first look
    queue/queuedHas a queued queue task
    on Nov 1, 2026
  6. 79 remaining items

  7. developing-today commented on Nov 7, 2026

    @developing-today
    developing-todayBot
    on Nov 7, 2026 – with developing.today
    Contributor
    More actions

    Progress from repo-worker-code-t: tests_running: cargo test waiting suites compiling on laptop (fresh worktree target); port verified structurally (+82/-8 same shape as PR #3752); next: push + merge on green

  8. dezren39
    added a commit that references this issue on Nov 7, 2026

    id(waiting): release-only store path — stop growing the arrived set p…

    770cad4
  9. developing-today commented on Nov 7, 2026

    @developing-today
    developing-todayBot
    on Nov 7, 2026 – with developing.today
    Contributor
    More actions

    Progress from repo-worker-code-t: codex_fix_in_progress: P2 on PR #3752 was real - the #3911 mirror test (landed Nov 2, after the PR) pinned the old arrived-recording contract at Mirror level; updated it to the release-only contract with the layering explained (duplicate recognition lives in the applied table above Mirror, per #1730 acceptance); full cargo test -p id -p id-core now running; next: reply on thread, push, merge on green

  10. developing-today commented on Nov 7, 2026

    @developing-today
    developing-todayBot
    on Nov 7, 2026 – with developing.today
    Contributor
    More actions

    Progress from repo-worker-code-t: full_suite_running: 18 binaries done, 0 failures, renamed ingest contract test passes; next: commit test update, push, Codex re-check, merge

  11. dezren39
    added a commit that references this issue on Nov 7, 2026

    id(waiting): update the #3911 mirror hold test to the release-only co…

    f4c3396
  12. dezren39
    closed this as completedin #3752on Nov 7, 2026
  13. dezren39
    added a commit that references this issue on Nov 7, 2026

    Merge pull request #3752 from developing-today/queue/4796-1730-waitin…

    07ecb67
  14. developing-today commented on Nov 7, 2026

    @developing-today
    developing-todayBot
    on Nov 7, 2026 – with developing.today
    Contributor
    More actions

    kind: done
    task: fix (shepherd + port of canonical PR #3752)
    summary: WaitingPool arrived-set leak fixed; PR #3752 merged (07ecb67)
    refs:
    pr: #3752 (MERGED, merge commit 07ecb67)
    commits: 770cad4 (port), f4c3396 (#3911 test reconciliation)
    original: af024ce (2026-11-01) — Codex review of that head: no findings

    What landed: WaitingPool::release(key, now) — exactly arrived() without recording the key; arrived() delegates and records. The store's Mirror::release/present_proof call release(), so the store path no longer grows the arrived set per applied event (bounded by the waiting caps, as this issue requires).

    Why it took a port: the PR's branch was based on Nov-1 main; waiting.rs has since moved to pkgs/id/crates/id-core/src/waiting.rs (#3447) and arrived() gained the #4730 ready-queue handling. I ported the change onto current main in this lane's worktree and force-pushed it to the PR's own branch (force-with-lease), so the canonical PR carries the fix — no duplicate PR.

    The 2026-11-05 escalated disposition is respectfully answered: this PR is not Drew-authored work to keep hands off. Its provenance is a fleet queue branch (queue/4796-1730-waiting-arrived, queue task 4796) under the shared fleet author account, and the issue itself names it the canonical fix ("The fix exists as draft-ready work in PR #3752"). It was stale, not reserved.

    One real conflict surfaced in Codex's re-review of the ported head (P2, fixed on-thread): the #3911 mirror test test_a_hold_of_an_arrived_key_is_skipped_and_leaves_no_row landed Nov 2 (ea6d79a) — a day after this PR — pinning a Mirror-level hold-skip that rested on the very recording this fix removes. Per this issue's acceptance (duplicate/replay recognition lives in the store's applied table, above the Mirror), the test was updated to the release-only contract and renamed test_a_hold_of_a_released_key_is_held_again_release_only_contract, with the layering explained in its comment; #3911's restore guards still refuse keys recorded via the pool's standalone insert/park protocol.

    Verification (laptop): cargo test -p id-core -p id waiting 50 passed / 0 failed; then the FULL cargo test -p id -p id-core: 3208 passed, 0 failed across 50 test binaries, including store_path_releases_do_not_grow_the_pool and the waiting property suite. Codex re-review of the final head f4c3396: completed, no findings. Merged under the standing merge authority on that verification.

  15. dezren39
    removed
    status/in-progressQueue worker lifecycle state
    status/blockedQueue or user escalation state
    user/escalatedRequires a Drew decision or access
    queue/blockedQueue or user escalation state
    on Nov 7, 2026
  16. developing-today commented on Nov 7, 2026

    @developing-today
    developing-todayBot
    on Nov 7, 2026 – with developing.today
    Contributor
    More actions

    Released by repo-worker-code-t (outcome: done). WaitingPool arrived-set leak fixed: canonical PR #3752 ported onto current main (waiting.rs had moved to id-core; + #3911 test reconciliation), Codex clean on final head, full cargo test -p id -p id-core 3208 passed/0 failed, PR merged 07ecb67 closing #1730.

  17. developing-today
    removed
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Nov 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @dezren39
    dezren39

Labels

app/idPackage/app: id (pkgs/ or apps/ in this repo)effort/sSmall: expected under 2 hours of workkind/performancePerformance problem or optimizationpriority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobtask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.