Skip to content

[PR] fix: expire writer verdicts with their tracked session window - #7032

Closed
Afloat16 wants to merge 2 commits into
ranxianglei:masterfrom
Afloat16:2026-11-17_writer-verdict-retention
Closed

Afloat16 wants to merge 2 commits into
ranxianglei:masterfrom
Afloat16:2026-11-17_writer-verdict-retention

Conversation

@Afloat16

Copy link
Copy Markdown
Contributor

Problem

createServedMarkerWriter bounds persisted servedAt entries at 128 sessions, but its separate conflict-verdict map retains every session ever seen. Expired one-minute verdicts and sessions evicted from the tracked window accumulate for the daemon's lifetime. A returning evicted session can also inherit its old throttled result and miss a new peer conflict until that TTL ends.

Change

Reclaim verdict entries inside the existing periodic marker prune when either their tracked session is gone or their existing verdict TTL has ended. Keep the active-session repeat throttle and the persisted marker's numeric timestamp format. This uses the existing retention policy and adds no configuration.

Standalone writer-marker bookkeeping only; request compression, rendering, identity and plugin routing do not change.

Verification

  • Base: 301e1a5459a77d5578206927c8062a58381af642.
  • Four new regressions: 3 fail / 1 passes on the base, with only a read-only verdict-count test observer added to expose the private cache. The behavioral returning-session test fails independently of that observer.
  • New and existing writer-marker suites: 19 passed.
  • Four batches of 500 distinct sessions retain 128 verdicts after every flush, instead of accumulating all prior IDs. An expired verdict is released while its longer-lived served timestamp remains; active verdicts still suppress repeated logs within one minute.
  • The returning-session regression creates a fresh peer marker after eviction and verifies the new conflict is detected.
  • Full npm run typecheck, npm run build, and git diff --check: passed.

Related #4989/#5028 concern shutdown/PID identity; #4630 clears the surfaced notice. Live searches and author history found no equivalent cleanup of this private map.

Fixes #7031

@ranxianglei ranxianglei changed the title fix: expire writer verdicts with their tracked session window [PR] fix: expire writer verdicts with their tracked session window Nov 17, 2026
Merge upstream master 6a641f3, including the architecture module-map and schedule-independent ranxianglei#2929 probe fixes.

Preserve the existing PR head and exact contribution patch. Validation of this refreshed head runs in upstream CI; no local test rerun is claimed.
@ranxianglei

Copy link
Copy Markdown
Owner

This fix is included verbatim (original commits and authorship preserved) in the merged batch PR #7074 — the changes are already on master. Closing to avoid a duplicate merge. 该修复已随批量 PR #7074 原样合入 master,为避免重复合并,关闭此 PR。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Writer conflict verdicts retain every historical session in daemon memory

2 participants